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
Client As Kleisli - Client Redesign Proposal #1772
Client As Kleisli - Client Redesign Proposal #1772
Conversation
case DisposableResponse(response, dispose) => | ||
response.copy(body = response.body.onFinalize(dispose)) | ||
def toHttpService: HttpService[F] = | ||
Kleisli{req: Request[F] => OptionT.liftF(fetch(req)(_.pure[F]))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright this I find interesting: If reading the body of the request after fetch results in an error, I think toHttpService
might not be expressible in terms of fetch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more problematic than that: the response is going to be closed when the _.pure[F]
runs, so we're returning a dead response body. We can't go from Stream
to F
without closing the resource.
There has been a lot of talk on Gitter. Not everybody follows there, so I'll summarize here. 1. Status quo
2.
|
Bench Results here I put them up on my website for fun. |
So it looks like we'd taking about a 3% hit, with some extra variance, in a tough scenario. This makes it possible to write a few things and easier to write a couple more things and easy to represent some incorrect things. Discuss. |
Another quick and dirty benchmark. Probably not as interesting as @jmcardon's.
This is proportionally a whole lot, marginally not a lot at all. |
Having studied gatling a bit more, the 3% comment above is misleading. We need to rerun the benchmarks. If we're at a real impasse here, it's possible to have the servers support both modes of operation. I think this is confusing and would rather not, but there is a compelling case for each. |
I think this is superseded by #2102? |
Yes, looks like it. Ok to close for me. |
Please reopen if we're wrong. |
With Syntax Class For Operations