<br><br><div class="gmail_quote">On Thu, Aug 6, 2009 at 4:16 AM, Philippe Marschall <span dir="ltr"><<a href="mailto:philippe.marschall@gmail.com">philippe.marschall@gmail.com</a>></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/5 Mariano Martinez Peck <<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>>:<br>
<div><div></div><div class="h5">> Hi! I am trying to understand how seaside handle double or more, request. I<br>
> started with the simpler example: WACounter, which has:<br>
><br>
> renderContentOn: html<br>
> Transcript show: 'renderContentOn'; cr.<br>
> html heading: count.<br>
> html anchor<br>
> callback: [ self increase ];<br>
> with: '++'.<br>
> html space.<br>
> html anchor<br>
> callback: [ self decrease ];<br>
> with: '--'<br>
><br>
><br>
> increase<br>
> Transcript show: 'increase'; cr.<br>
> count := count + 1.<br>
> (Delay forSeconds: 3) wait.<br>
><br>
><br>
> Now, suppose the counter is in 0. I click one time on '++' and wait and I<br>
> see in the transcipt:<br>
><br>
> increase<br>
> renderContentOn<br>
><br>
> Ok, perfect. New session, 0 again. Now I click on '++' but before it finish,<br>
> I click 3 times more (very quickly). I can see this in the transcipt:<br>
><br>
> increase<br>
> increase<br>
> increase<br>
> increase<br>
> renderContentOn<br>
><br>
> So, as I can see:<br>
><br>
> 1) the callback (self increase in this case) is called for every click.<br>
> 2) the renderContentOn isn't call until all of the self increase of that<br>
> session finish.<br>
> 3) when renderContentOn is called, the webpage shows the number 1 (which is<br>
> correct instead of 4).<br>
><br>
> Now the questions are:<br>
><br>
> a) how does seaside can do that? every request has its own variables? I<br>
> think this has to be with continuations but I want to be sure.<br>
<br>
</div></div>I order of you observations:<br>
1) You (your browser) makes three callback requests and discards the<br>
redirect to render for the first two</blockquote><div><br>Ok, but which is the "condition" to be discarded? if the callback request is finished but there are others callbacks request then it is discarded? <br> </div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
2) There is a lock that allows only one request per session at a time,<br>
otherwise your components would have to be thread safe<br>
3) state backtracking, before every request the state of the counter<br>
is reverted to 0</blockquote><div><br>that's because there was the method states ? <br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<div class="im"><br>
> b) which of all of the self increase is the one that is finally rendered?<br>
> the first one?<br>
<br>
</div>That should be the last one. The browser should discard processing the<br>
previous requests. Disable backtracking to be sure.</blockquote><div><br>what do you mean with Disable backtracking ? remove the method states from the component? <br><br>Thanks!<br><br>mariano<br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
Cheers<br>
<font color="#888888">Philippe<br>
</font><div><div></div><div class="h5">_______________________________________________<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>