<div dir="ltr">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...<br>
<div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/16 Loïc Hoguin <span dir="ltr"><<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>></span><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
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.<br>
<br>
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.<div class="im">
<br></div></blockquote></div></div></div>