Thanks.<br>There seems to be several technologies to realize this push or polling.<br><br>Is what you explained feasible on the user&#39;s side of happstack-server (I mean, if I can do it myself)?<br>If I take an empty MVar in my ServerPartTs, which are read over client&#39;s request,<br>
I think that nothing will be sent back to the browser and it will remain blank!<br>Is that to be combined with an HTTP refresh timer on the client side?<br><br>By sessions, you mean sessions that I create myself for every client connected?<br>
<br>Regards,<br>Corentin<br><br><br><br><div class="gmail_quote">On Wed, Jan 19, 2011 at 2:21 PM, Bas van Dijk <span dir="ltr">&lt;<a href="mailto:v.dijk.bas@gmail.com">v.dijk.bas@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On 17 January 2011 21:50, Jeremy Shaw &lt;<a href="mailto:jeremy@n-heptane.com">jeremy@n-heptane.com</a>&gt; wrote:<br>
&gt;<br>
&gt; On Jan 17, 2011, at 2:19 PM, Corentin Dupont wrote:<br>
&gt;<br>
&gt; Indeed, I tried with &lt;META HTTP-EQUIV=&quot;Refresh&quot; CONTENT=&quot;n&quot;&gt; ?<br>
&gt; and it&#39;s unusable.<br>
&gt; It make blink the page, ungrey the &quot;stop&quot; button for a second and make the<br>
&gt; fields loose the focus<br>
&gt; so it&#39;s impossible to type in.<br>
&gt;<br>
&gt; I&#39;ll try with XMLHTTPRequest.<br>
&gt;<br>
&gt;<br>
&gt; Right. Using the jQuery library should make it easier to do ajax requests<br>
&gt; and modify the DOM on the fly,<br>
&gt; <a href="http://jquery.com/" target="_blank">http://jquery.com/</a><br>
&gt; - jeremy<br>
</div></div>&gt; _______________________________________________<br>
&gt; Haskell-Cafe mailing list<br>
&gt; <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
&gt;<br>
&gt;<br>
<br>
A nice variation of polling is &quot;long polling&quot;:<br>
<br>
<a href="http://en.wikipedia.org/wiki/Push_technology#Long_polling" target="_blank">http://en.wikipedia.org/wiki/Push_technology#Long_polling</a><br>
<br>
This can easily be accomplished in Haskell by having an MVar per<br>
session. Initially an empty MVar is created per new session. When a<br>
client makes a request, the server thread that handles the request<br>
takes the MVar belonging to the session. This thread will block until<br>
the MVar is filled. When the server has an update it will fill all the<br>
MVars. This causes all the blocked threads to continue with sending a<br>
response to the client notifying it about the update.<br>
<br>
Like Jeremy said it&#39;s a good idea to make these update requests asynchronous.<br>
<br>
Regards,<br>
<font color="#888888"><br>
Bas<br>
</font></blockquote></div><br>