blob: 9672e31761eabb972b68a3b098945af66fe63f29 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
|
<tt>
<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><br>
<div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/16 Loïc Hoguin <span dir="ltr"><<a href="mailto:[email protected]" target="_blank">[email protected]</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"><br>
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>
<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>
<br></div></blockquote></div></div></div><br>
</tt>
|