[Israel.pm] Talk: A natural flow for web apps
eilara at cortext.co.il
Thu Mar 25 04:36:33 PST 2004
>> The issue here is not state. It is flow.
> The model you are reaching for is continuations.
Yes. In the talk we will see a working example using the Coro module.
Does anyone have any experience with it?
> Google for cgi and continuations, you'll find a few
> leads, including some discussion by Dan Sugalski.
What is more interesting is the pointer that Gaal gave. It took me on
a very educating trail. Turns out, for example, that someone once
posed the exact same problem/solution on some TCL mailing list. And
there are entire frameworks for exactly this type of web app
(http://www.beta4.com/seaside2/). And Yahoo Stores runs on such a
Here is a page with mucho info (and a tiny bit of hype) on the topic:
I came to this problem from work on desktop->web UI translation. In
desktop UI code you see things like:
$window->confirm($delete_user_icon, 'are you sure?');
I had no way to provide this kind of API without continuations in Perl.
When I asked migo for help he suggested faking it with threading (as I
think Roie was saying), but it seemed way beyond me.
Then recently I saw the Coro module.
Desktop UI frameworks I have seen, do this by having each window spin
its own event loop, and blocking all events except those coming from the
OK/Cancel window. If the event loop on the desktop is the accept loop on
the web, then this is the equivalent to having our prompt() sub hijack
the HTTP connection from the main web server (the event blocking
behavior of modal dialogs), and run its own web server for the duration
of one request.
More information about the Perl