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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Blaze client creation and deprecate BlazeSimpleHttp1Client #1523

Merged
merged 7 commits into from Dec 23, 2017

Conversation

Projects
None yet
4 participants
@aeons
Member

aeons commented Nov 4, 2017

This is just the simplest possible solution to #1522.

Closes #1522

Show outdated Hide outdated blaze-client/src/main/scala/org/http4s/client/blaze/Http1Client.scala Outdated
Show outdated Hide outdated blaze-client/src/main/scala/org/http4s/client/blaze/package.scala Outdated
Show outdated Hide outdated blaze-client/src/main/scala/org/http4s/client/blaze/package.scala Outdated
Show outdated Hide outdated .../src/test/scala/org/http4s/client/blaze/BlazeSimpleHttp1ClientSpec.scala Outdated
@@ -50,7 +50,7 @@ speaks HTTP 1.x.
```tut:book
import org.http4s.client.blaze._
val httpClient = PooledHttp1Client[IO]()
val httpClient = Http1Client[IO]().unsafeRunSync

This comment has been minimized.

@rossabaker

rossabaker Nov 9, 2017

Member

I get what's going on here, but this runs against "unsafeRunSync only at the end of the world." But putting the entire tut into a comprehension also won't work. Maybe we need to explain ourselves here?

@rossabaker

rossabaker Nov 9, 2017

Member

I get what's going on here, but this runs against "unsafeRunSync only at the end of the world." But putting the entire tut into a comprehension also won't work. Maybe we need to explain ourselves here?

This comment has been minimized.

@ChristopherDavenport

ChristopherDavenport Nov 10, 2017

Member

This is a hard issue as best practice would be using the streaming iterface and using it only where we need it, probably in multiple blocks calling different clients. Although in an app you generally want 1 client bracketed near the beginning.

@ChristopherDavenport

ChristopherDavenport Nov 10, 2017

Member

This is a hard issue as best practice would be using the streaming iterface and using it only where we need it, probably in multiple blocks calling different clients. Although in an app you generally want 1 client bracketed near the beginning.

This comment has been minimized.

@rossabaker

rossabaker Nov 10, 2017

Member

Yeah, I think in some of the other ones we can flatmap our way to victory. This one, since it's a longer narrative, is the chewy one.

@rossabaker

rossabaker Nov 10, 2017

Member

Yeah, I think in some of the other ones we can flatmap our way to victory. This one, since it's a longer narrative, is the chewy one.

This comment has been minimized.

@ChristopherDavenport

ChristopherDavenport Nov 10, 2017

Member

At a minimum we need to add comments on why this was done.

@ChristopherDavenport

ChristopherDavenport Nov 10, 2017

Member

At a minimum we need to add comments on why this was done.

@ChristopherDavenport

This comment has been minimized.

Show comment
Hide comment
@ChristopherDavenport

ChristopherDavenport Nov 25, 2017

Member

ping @aeons

Do you have any time to update the comment for client.md? If not I'll push that up for you as I think we're ready to approve otherwise.

Member

ChristopherDavenport commented Nov 25, 2017

ping @aeons

Do you have any time to update the comment for client.md? If not I'll push that up for you as I think we're ready to approve otherwise.

@aeons

This comment has been minimized.

Show comment
Hide comment
@aeons

aeons Nov 25, 2017

Member

Completely forgot this again. I’m completely booked this weekend, so you can just push what you want.

Member

aeons commented Nov 25, 2017

Completely forgot this again. I’m completely booked this weekend, so you can just push what you want.

@aeons

This comment has been minimized.

Show comment
Hide comment
@aeons

aeons Dec 11, 2017

Member

Right now, there's an apply that gives you back an F[Http1Client[F]], and a stream method that uses bracket to give you back a Stream[F, HttpClient[F]].

The apply just wraps creation in F.delay.

If you guys are ok with those two, we could add an unsafeCreate, that returns a raw Http1Client[F], and use that in docs with a note that you should probably use the stream variant?

Member

aeons commented Dec 11, 2017

Right now, there's an apply that gives you back an F[Http1Client[F]], and a stream method that uses bracket to give you back a Stream[F, HttpClient[F]].

The apply just wraps creation in F.delay.

If you guys are ok with those two, we could add an unsafeCreate, that returns a raw Http1Client[F], and use that in docs with a note that you should probably use the stream variant?

@jmcardon jmcardon merged commit bf32d9a into http4s:master Dec 23, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@aeons aeons deleted the aeons:blaze-client-creation branch Dec 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment