blob: f2a6ab12a4df0efdcc65b195e76a97a513330785 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<tt>
<div dir="ltr">thanks. Suppose my external process is registered and has a name, so I can discover it by name from my cowboy request handler. when my cowboy handler is invoked, can I just send the handler's process ID to the external process? the question is then how does the external process know that the http client has disconnected so that it can stop sending data to it.</div><br>
<div class="gmail_extra"><br><br><div class="gmail_quote">2013/9/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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<div class="HOEnZb"><div class="h5">On 09/16/2013 03:50 PM, akonsu wrote:<br><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hello,<br><br>
<br><br>
this is somewhat similar to what someone else has asked:<br><br>
<a href="http://lists.ninenines.eu:81/archives/extend/2013-August/000224.html" target="_blank">http://lists.ninenines.eu:81/<u></u>archives/extend/2013-August/<u></u>000224.html</a><br><br>
<br><br>
I am new to cowboy, I have a process that runs alongside a cowboy server<br><br>
and this process needs to periodically send text to all http clients<br><br>
connected to the cowboy server. My goal is to have a streaming<br><br>
connection for each http client so that I could stream text to them from<br><br>
my process. how is this done?<br><br>
</blockquote><br>
<br></div></div><br>
Same answer really. You need some kind of process registry, like gproc properties for example, that will store all Pids and allow you to send a message to all of them.<br><br>
<br><br>
On init, register the process, and then handle the incoming message when it arrives.<span class="HOEnZb"><font color="#888888"><br><br>
<br><br>
-- <br><br>
Loďc Hoguin<br><br>
Erlang Cowboy<br><br>
Nine Nines<br><br>
<a href="http://ninenines.eu" target="_blank">http://ninenines.eu</a><br><br>
</font></span></blockquote></div><br></div><br>
</tt>
|