-
Notifications
You must be signed in to change notification settings - Fork 786
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
removed the Ref boolean #6654
removed the Ref boolean #6654
Conversation
Thanks for retargeting! At least according to #6325 (review) we do still need the |
676a453
to
cec7ec9
Compare
05ed774
to
d640a7c
Compare
Remove un-needed Context Bound Co-authored-by: Arman Bilge <armanbilge@gmail.com>
@armanbilge @danicheg @kubukoz I think the ClientSuite test is missing the case for Stream Request -> Strict Response, and Stream Request -> Stream Response. I'd like to add these tests, and then will this PR be good to go? |
@geoffjohn11 thanks for all your work on this! Yes please, adding tests is always great, good catch. |
@armanbilge Thanks for your feedback and reviews! Hopefully this is good to go. |
refOp.fold { | ||
Resource.suspend(Ref[F].of(false).map { disposed => | ||
Resource | ||
.eval(F.pure(resp.pipeBodyThrough(until(disposed)))) | ||
.onFinalize(disposed.set(true)) | ||
}) | ||
} { disp => | ||
Resource | ||
.eval(F.pure(resp.pipeBodyThrough(until(disp)))) | ||
.onFinalize(disp.set(true)) |
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.
I'm a little confused by these lines.
Resource.eval(F.pure(...))
is equivalent toResource.pure(...)
- Since the code is the same, and there is just the issue of whether the
Ref
is provided or not, I think you can dorefOp.fold(Ref[F].of(false))(F.pure).flatMap { disp => ... }
and then share the code.
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.
@armanbilge I think I fixed the duplication, let me know if you'd like additional changes. Thanks for the review!
client/shared/src/test/scala/org/http4s/client/ClientSuite.scala
Outdated
Show resolved
Hide resolved
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.
Sorry for the very slow review cycle :( I appreciate your continued work on this.
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.
I think this is good. Thanks for all your work on it.
General comment (not related to your changes): personally I found run
difficult to reason about (and thus this PR difficult to review), since it handles both requests/responses and calls itself recursively. I wonder if anyone else feels the same.
PR to address Ref comment in #6325 (review)