Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding function to configure an AsyncHttpClient with a client config builder #3623

Closed
wants to merge 5 commits into from
Closed

Adding function to configure an AsyncHttpClient with a client config builder #3623

wants to merge 5 commits into from

Conversation

jyoo980
Copy link
Contributor

@jyoo980 jyoo980 commented Aug 4, 2020

Hello 馃憢

I use Scala at work, but I'd consider myself a relative newcomer to the language. I tried implementing the work outlined in #3606 as my first foray into open-source Scala. I'm eager to learn so please let me know if I'm on the right track 馃檪

@@ -57,7 +57,6 @@ object AsyncHttpClient {
* Create an HTTP client based on the AsyncHttpClient library
*
* @param config configuration for the client
* @param ec The ExecutionContext to run responses on
Copy link
Contributor Author

@jyoo980 jyoo980 Aug 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These functions no longer consume an ExecutionContext, removed outdated comments.

Copy link
Member

@rossabaker rossabaker Aug 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. It's surprising, for all the other nice linters Scala has, that we don't have this for docs.

def clientResource = AsyncHttpClient.resource[IO]()

"AsyncHttpClient configure" should {
Copy link
Contributor Author

@jyoo980 jyoo980 Aug 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No tests existed at all for AsyncHttpClient, I saw what was being done in other test files and tried to replicate it here.

Copy link
Contributor

@hamnis hamnis Aug 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think the configuration has a useful equals, so this test is not working

Copy link
Contributor Author

@jyoo980 jyoo980 Aug 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the tests to assert on the fields themselves, rather than the object.

@jyoo980 jyoo980 marked this pull request as draft Aug 4, 2020
Copy link
Contributor

@hamnis hamnis left a comment

First of all, thanks for this.
Its good to see new people contributing. We highly appreciate it.

Good spotted that we didn't have tests for AsyncHttpClient.

def clientResource = AsyncHttpClient.resource[IO]()

"AsyncHttpClient configure" should {
Copy link
Contributor

@hamnis hamnis Aug 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think the configuration has a useful equals, so this test is not working

@jyoo980 jyoo980 marked this pull request as ready for review Aug 4, 2020
Copy link
Member

@rossabaker rossabaker left a comment

Thanks! This looks binary compatible, and I think we could put it on series/0.21 and release it sooner.

@@ -57,7 +57,6 @@ object AsyncHttpClient {
* Create an HTTP client based on the AsyncHttpClient library
*
* @param config configuration for the client
* @param ec The ExecutionContext to run responses on
Copy link
Member

@rossabaker rossabaker Aug 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. It's surprising, for all the other nice linters Scala has, that we don't have this for docs.

@jyoo980
Copy link
Contributor Author

jyoo980 commented Aug 4, 2020

@rossabaker thanks for your feedback!

Looking to contribute more in the future 馃榿

hamnis
hamnis approved these changes Aug 4, 2020
@rossabaker
Copy link
Member

rossabaker commented Aug 5, 2020

Picked as 3e687e7, so this can be in 0.21.7. Thanks again, @jyoo980.

@rossabaker rossabaker closed this Aug 5, 2020
@rossabaker rossabaker added this to the 0.21.7 milestone Aug 5, 2020
@rossabaker rossabaker added enhancement Feature requests and improvements retarget Cherry-pick or reopen on another branch labels Aug 5, 2020
@jyoo980 jyoo980 deleted the jy/async-http-client-custom-request-timeout branch Aug 8, 2020
armanbilge pushed a commit to http4s/http4s-async-http-client that referenced this pull request May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests and improvements retarget Cherry-pick or reopen on another branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants