<div dir="ltr">thanks!<div><br></div><div>how to implement timeout callback manually? if I had receive then I would just use timeout clause there, but with the handler I do not know...<br><div><br></div><div>I have doubts about validity of my question on the erlang list.  I later realised that there is no problem receiving messages in my handler from my upstream process, I can do it fast enough and shove everything to the response. my real problem is to determine if the http client is reading fast enough from the response...</div>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/20 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Loop handlers close after a while regardless of what you send, it only checks what the client sends. The best way for you would be to disable that timeout and handle it manually.<br>
<br>
As for the second question, I'm still reading the thread on erlang-questions but I've seen some good ideas about timestamps so far.<div><div class="h5"><br>
<br>
On 09/20/2013 08:47 PM, akonsu wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hi,<br>
<br>
I am using loop handler and I stream from it:<br>
<br>
info({stream, Part}, Req, S) -><br>
     ok = cowboy_req:chunk(Part, Req),<br>
     {loop, Req, S, hibernate};<br>
<br>
I have two questions:<br>
<br>
1. on timeouts cowboy sends 204 No Content. In my case it is not the<br>
right response because I may have already sent some data. Is there a way<br>
to send a custom response?<br>
<br>
2. how to check if the client is too slow and is not reading the<br>
response stream fast enough? If this happens, then I need to disconnect.<br>
<br>
I can live without 1. but I need to figure out 2. Please help.<br>
<br>
thank you!<br>
Konstantin<br>
<br>
<br>
<br></div></div>
______________________________<u></u>_________________<br>
Extend mailing list<br>
<a href="mailto:Extend@lists.ninenines.eu" target="_blank">Extend@lists.ninenines.eu</a><br>
<a href="http://lists.ninenines.eu:81/listinfo/extend" target="_blank">http://lists.ninenines.eu:81/<u></u>listinfo/extend</a><br>
<br><span class="HOEnZb"><font color="#888888">
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
<br>
-- <br>
Loďc Hoguin<br>
Erlang Cowboy<br>
Nine Nines<br>
<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br>
</font></span></blockquote></div><br></div>