-
Notifications
You must be signed in to change notification settings - Fork 286
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
Stream output is not working on master #655
Comments
I confirm |
The problem is in this call: Implementation of the socket(_ReqKey) ->
undefined. |
Also this code fragment looks suspicious: https://github.com/ChicagoBoss/ChicagoBoss/blob/master/src/boss/boss_web_controller_handle_request.erl#L172
|
Minor correction, but set_response_data/1 has always actually been a /2 Bridge:set_response_data(Data) is exactly the same as However, it is backwards compatible (Bridge:set_response_data(Data) is That said, I'm open to some some ideas to make it work better with Cowboy. I have an undocumented hack in the cowboy bridge to support streaming, if That functionality currently only works with Cowboy and simple_bridge On Thu, Sep 1, 2016 at 8:37 AM, Evgeny M. notifications@github.com wrote:
Jesse Gumm |
yeah i already realised that /1 and /2 are related to pmod, but deleted the message too late :) |
I don't like the Size requirement either, and I believe it used to be part of the cowboy specs, but it seems to be fixed in 1.1.x (https://github.com/ninenines/cowboy/blob/1.1.x/src/cowboy_rest.erl#L863-L871) I'll have to tweak it accordingly to allow Or, as always, I'm open to pull requests :) |
The code below in handle_response(Bridge, _Payload = {stream, Generator, Acc0}, RequestMethod) ->
Bridge:set_response_data({chunked,
fun(SendChunked) ->
process_stream_generator(SendChunked, RequestMethod, Generator, Acc0)
end
});
Requires this nitrogen/simple_bridge#59 pull for simple_bridge and cowboy 1.1.x (currently 1.0.3 in rebar.config) |
It doesn't work unfortunately: server returns chunks without headers and then throws updated Aww, forget about this, it was my fault — passed Content-length as integer and got a bunch of weird errors. It's working fine now |
How to reproduce: create sample project with controller like this:
It fails in cowboy/mochiweb backends with different reasons:
mochiweb
cowboy
The text was updated successfully, but these errors were encountered: