Thanks a lot for your response Jeremy.<br>I can see a lot of site that does update infos without the user to have to click &quot;refresh&quot; (I think Facebook does?).<br>Do they do polling?<br>I think this approach would be fine for me, my app if not very fast paced.<br>
Then I don&#39;t need to add a event handler to happstack-state ;)<br><br>This is done with something like:<code> &lt;META HTTP-EQUIV=&quot;</code><i>Refresh</i><code>&quot; CONTENT=&quot;</code><b>n</b><code>&quot;&gt;</code> ?<br>
<br>Thanks,<br>Corentin<br><br><br><div class="gmail_quote">On Mon, Jan 17, 2011 at 5:41 PM, Jeremy Shaw <span dir="ltr">&lt;<a href="mailto:jeremy@n-heptane.com">jeremy@n-heptane.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 style="word-wrap: break-word;">Hello,<div><br></div><div>The problem is that clients are not &#39;connected&#39; to the web server. The way it works (more or less) is:</div><div><br></div><div> 1. client connects to server and sends a Request</div>
<div> 2. server sends a Response</div><div> 3. connection is terminated.</div><div><br></div><div>So, once the page has been loaded there is no connection between the web-server and the client. Hence there is no way for the server to send anything to the clients.</div>
<div><br></div><div>In HTML 5, there is something known as web sockets with does allow you to have a persistent connection to the clients. However, it does not yet have broad browser support. In fact, some browsers have temporarily removed support due to a security flaw in the design specification.</div>
<div><br></div><div>There are a variety of hacks collectively known as &#39;comet&#39; for trying to create a persistent connection on top of the existing HTTP 1.1 standard:</div><div><br></div><div><a href="http://en.wikipedia.org/wiki/Comet_%28programming%29" target="_blank">http://en.wikipedia.org/wiki/Comet_(programming)</a></div>
<div><br></div><div>That deals with trying to have the server push updates to the client.</div><div><br></div><div>A different approach is to have the clients pull new data from the server by polling the server for changes every now and then. But that depends on how much latency you can afford for the updates. For example,  if updating only once a minute is fine versus must update every second.</div>
<div><br></div><div>Once you decide how to get the data to the client, then you can figure out how to track changes to the MACID database. </div><div><br></div><font color="#888888"><div>- jeremy</div></font><div class="im">
<div><br><div><div>On Jan 17, 2011, at 4:58 AM, Corentin Dupont wrote:</div><br><blockquote type="cite">Hello again, <br>I have another question for happstack users/experts:<br><br>I have a program with happstack-state and a web server with happstack-server.<br>
What I&#39;d like is, whenever the MACID state is changed, that the web page is refreshed for every clients<br> connected on the web server.<br><br>So I think the question is 2 fold:<br>- How to add an event handler on happstack-state for that?<br>
- How to ask to the web server to refresh every clients?<br><br>I did not found infos about that in the API.<br> <br>Thanks a lot,<br>Corentin<br><br></blockquote></div><br></div></div></div></blockquote></div><br>