Message-ID: <1631653066.2889.1369331786598.JavaMail.email@example.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2888_436442453.1369331786597" ------=_Part_2888_436442453.1369331786597 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
There's a demo, I think its via Seaside, of a command line application w= hich is trivially ported to a web application thanks to the power of contin= uations.
Another example of a 'command line' type application which is easily por= ted to a web application via continuations is the Modal Web Server example 3. In that example the 'flow' of the= code is unchanged, only the functions for retrieving input and displaying = the result are modified.
Essentially the readLine() type functionality common with command line t= ools is replaced by a continuation.
A good presentiation of the benefits of Continuations is web application=
s can be found here. The source of a complete number guess=
game that uses continuations can be found here. It boils down to=
control being returned to the user when the
pause() method is=
called and this serves at the same time as a marker to resume execution fr=
Increasingly as we glue together services, be they web applications, Web= Services, MOM and SOA type services, we need to handle long running workfl= ows and things should be asynchronous. e.g. a workflow may take 1 year to c= omplete.
However using a simple sequential programming model is much simpler than= the asynchronous alternative.
Continuations allow us an easy way to suspend execution of a workflow/co= rrelation at the point of a wait/correlation state, so that the thread of c= ontrol can be serialised nicely and resumed when the next message/event occ= urs, maybe some long time ahead.
Various dynamic languages support continuations like Squeek and Ruby. Be= ing able to make effficient ports of these languages which work effectively= with existing Java code requires native continuations support