Excellent. Now I get it. Thank you so much for your answers.<br><br>Best,<br><br>Mariano<br><br><div class="gmail_quote">On Thu, Aug 6, 2009 at 5:22 PM, Philippe Marschall <span dir="ltr">&lt;<a href="mailto:philippe.marschall@gmail.com">philippe.marschall@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">2009/8/6 Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>&gt;:<br>

<div><div></div><div class="h5">&gt;<br>
&gt;<br>
&gt; On Thu, Aug 6, 2009 at 4:16 AM, Philippe Marschall<br>
&gt; &lt;<a href="mailto:philippe.marschall@gmail.com">philippe.marschall@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; 2009/8/5 Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>&gt;:<br>
&gt;&gt; &gt; Hi! I am trying to understand how seaside handle double or more,<br>
&gt;&gt; &gt; request. I<br>
&gt;&gt; &gt; started with the simpler example: WACounter, which has:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; renderContentOn: html<br>
&gt;&gt; &gt;     Transcript show: &#39;renderContentOn&#39;; cr.<br>
&gt;&gt; &gt;     html heading: count.<br>
&gt;&gt; &gt;     html anchor<br>
&gt;&gt; &gt;         callback: [ self increase ];<br>
&gt;&gt; &gt;         with: &#39;++&#39;.<br>
&gt;&gt; &gt;     html space.<br>
&gt;&gt; &gt;     html anchor<br>
&gt;&gt; &gt;         callback: [ self decrease ];<br>
&gt;&gt; &gt;         with: &#39;--&#39;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; increase<br>
&gt;&gt; &gt;     Transcript show: &#39;increase&#39;; cr.<br>
&gt;&gt; &gt;     count := count + 1.<br>
&gt;&gt; &gt;     (Delay forSeconds: 3) wait.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Now, suppose the counter is in 0. I click one time on &#39;++&#39; and wait and<br>
&gt;&gt; &gt; I<br>
&gt;&gt; &gt; see in the transcipt:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; increase<br>
&gt;&gt; &gt; renderContentOn<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Ok, perfect. New session, 0 again. Now I click on &#39;++&#39; but before it<br>
&gt;&gt; &gt; finish,<br>
&gt;&gt; &gt; I click 3 times more (very quickly). I can see this in the transcipt:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; increase<br>
&gt;&gt; &gt; increase<br>
&gt;&gt; &gt; increase<br>
&gt;&gt; &gt; increase<br>
&gt;&gt; &gt; renderContentOn<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; So, as I can see:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 1) the callback (self increase in this case) is called for every click.<br>
&gt;&gt; &gt; 2) the renderContentOn isn&#39;t call until all of the self increase of that<br>
&gt;&gt; &gt; session finish.<br>
&gt;&gt; &gt; 3) when renderContentOn  is called, the webpage shows the number 1<br>
&gt;&gt; &gt; (which is<br>
&gt;&gt; &gt; correct instead of 4).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Now the questions are:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; a) how does seaside can do that? every request has its own variables? I<br>
&gt;&gt; &gt; think this has to be with continuations but I want to be sure.<br>
&gt;&gt;<br>
&gt;&gt; I order of you observations:<br>
&gt;&gt; 1) You (your browser) makes three callback requests and discards the<br>
&gt;&gt; redirect to render for the first two<br>
&gt;<br>
&gt; Ok, but which is the &quot;condition&quot; to be discarded? if the callback request is<br>
&gt; finished but there are others callbacks request then it is discarded?<br>
<br>
</div></div>Seaside doesn&#39;t discard anything, the browser has to. Here&#39;s a rough<br>
sketch of what happens:<br>
- You initiate a content exchange for the &quot;callbacks page&quot;.<br>
- The browser sends a request.<br>
- The Seaside callback machinery kicks in.<br>
- Before Seaside can send a response you initiate three more requests<br>
resulting in three more requests.<br>
<br>
Seaside doesn&#39;t really have a problem with this, it will process these<br>
requests one after another, meaning &quot;executing&quot; the same &quot;callback<br>
page&quot; several times and send the redirect response to the render page<br>
for each one. However the browser has, he has just one pane where he<br>
can render the resonse. So he&#39;ll have to discard all but one of the<br>
responses. The least bad thing is to discard all but the last one.<br>
<div class="im"><br>
&gt;&gt;<br>
&gt;&gt; 2) There is a lock that allows only one request per session at a time,<br>
&gt;&gt; otherwise your components would have to be thread safe<br>
&gt;&gt; 3) state backtracking, before every request the state of the counter<br>
&gt;&gt; is reverted to 0<br>
&gt;<br>
&gt; that&#39;s because there was the method states ?<br>
<br>
</div>Yes<br>
<div class="im"><br>
&gt;&gt;<br>
&gt;&gt; &gt; b) which of all of the self increase is the one that is finally<br>
&gt;&gt; &gt; rendered?<br>
&gt;&gt; &gt; the first one?<br>
&gt;&gt;<br>
&gt;&gt; That should be the last one. The browser should discard processing the<br>
&gt;&gt; previous requests. Disable backtracking to be sure.<br>
&gt;<br>
&gt; what do you mean with Disable backtracking ? remove the method states from<br>
&gt; the component?<br>
<br>
</div>Yes<br>
<div><div></div><div class="h5"><br>
Cheers<br>
Philippe<br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div></div></blockquote></div><br>