[erlang-questions] Getting chunked responses with ibrowse

Chandru chandrashekhar.mullaparthi@REDACTED
Sun Jun 16 23:24:35 CEST 2013


Hi Chris,

Can you turn on ibrowse tracing and send me the trace output? What you are
trying to do should be possible, though I'm not sure if you can have a
timeout value that large (days/months).

Chandru

On 11 June 2013 04:13, Chris Hicks <khandrish@REDACTED> wrote:

> Hello all,
>
> I've been playing around with ibrowse, trying to get chunked responses
> from a server and the behavior I'm seeing isn't at all what I expect given
> the documentation.
>
> When I send the following request:
>
> ibrowse:send_req(URL, [], get, [], [{stream_to, self()}]).
>
> I get the headers back from the server immediately...and then no messages
> after that, until the timeout message anyway. From what the documentation
> says, I'd expect to just continue to get messages "as data arrives on the
> socket" but this apparently isn't the case.
>
> If I call stream_next(Request_id) nothing happens at all. However, if I
> instead change the call to:
>
> ibrowse:send_req(URL, [], get, [], [{stream_to, {self(), once}}]).
>
> I get the headers, and then when I call stream_next(Request_id) I suddenly
> begin to get the packets the server is sending.
>
> Can anyone explain to me why I am seeing what I am seeing?
>
> The use case I am trying to fulfill is that I connect to a server and get
> a set of data back that describes the state of the server as a json object.
> On any changes, which might not happen for a very long time (days/months),
> a new set of data is streamed to the client. I would like to have one
> process receiving multiple streams, from multiple servers, handling these
> status changes. Is this possible, or will I need to spin up workers for
> each stream and have them wait for new data, providing it to that central
> process?
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130616/8f27da7f/attachment.htm>


More information about the erlang-questions mailing list