-
Notifications
You must be signed in to change notification settings - Fork 44
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
Make wait_for_first_flush
configurable in streaming responses
#66
Make wait_for_first_flush
configurable in streaming responses
#66
Conversation
403b225
to
a3a6897
Compare
The Alpine tests are failing for some Docker reasons unrelated to the changes in this PR. |
An alternative to this PR would be to add a This is what |
Any progress here @seliopou? Would like to be able to try this out in master. |
That name's fine for use internally but not great in conveying what the option does to the user. Maybe something more like Also, it looks like the build's failing due to alpine, which was removed from the |
@seliopou |
Yep. Wait, how about |
@seliopou I was actually gonna suggest either |
I think either one improves on the current name. It's not really flushing anything but it is ensuring that the next write will produce data to send. |
This is related to #65. I managed to get websockets working using Conduit in order to gain access to the file descriptors. However, because streaming responses wait for the first write to flush response bodies, I could never deliver the connection upgrade with 1. an empty response body and 2. while not closing the writer. Making `wait_for_first_flush` configurable (which I see was already in the roadmap) solves this problem. I've tested this in my code and it's working really well now. Please let me know if you had thought of another way of configuring this behavior.
a3a6897
to
e22c6bb
Compare
@seliopou thanks for your comments. I made the suggested changes and rebased on master. |
So turns out that renaming the param also involved changing the boolean value, and I forgot to do that. My latest commit does exactly that and also adds a test for this behavior because I don't trust myself anymore. |
Looks good, thanks! |
This is related to #65. I managed to get websockets working using
Conduit in order to gain access to the file descriptors. However,
because streaming responses wait for the first write to flush response
bodies, I could never deliver the connection upgrade with 1. an empty
response body and 2. while not closing the writer.
Making
wait_for_first_flush
configurable (which I see was already inthe roadmap) solves this problem.
I've tested this in my code and it's working really well now. Please
let me know if you had thought of another way of configuring this
behavior.