[99s-extend] timeout in cowboy loop handler

akonsu akonsu at gmail.com
Wed Oct 16 06:42:02 CEST 2013


ok. the data that I need to send are coming as erlang messages to the
process that runs my handler. so it sounds like if I want to use the
"normal" cowboy_http_handler, then I need a receive loop inside handle(Req,
State) callback, right? Basically, my response stream will potentially
never end, I do not know how to handle this properly in cowboy...


2013/10/16 Loïc Hoguin <essen at ninenines.eu>

> Loop handlers are designed to wait for a long time with the socket *idle*
> and then eventually send one response then close the socket. Things like
> long-polling.
>
> What you are doing is just streaming, for which you do not need a timeout
> because the socket isn't idle. You are just sending a large response, and
> normal handlers are perfectly capable of doing that.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ninenines.eu/archives/extend/attachments/20131016/abe38a1a/attachment.html>


More information about the Extend mailing list