[Israel.pm] Talk: A natural flow for web apps

Ran Eilam eilara at cortext.co.il
Thu Mar 25 13:02:26 PST 2004


>> Ran Eilam wrote:

>> 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.

> Gaal Yahas wrote:

> How do you take over the socket for one request?

You cannot. I am just saying that WITHOUT continuations, that is what
you would need to do. Somehow.

I mentioned this because someone asked how is this different from GUI
event-based programming. I guess this is the difference: you cannot use
the desktop UI solution for web apps (switching the active event loop
between subs).

Which is why on the desktop we have a blocking confirm(), alert(),
select_file/color(), and on the web we don't. 

In mod_perl for example, you have one event loop, and it is not yours to
play with. Perhaps the API could be expanded to allow you to do blocking
prompt()-like subs, which is, I think, what Kogman suggested when he was
talking about a custom web server.

Ran



More information about the Perl mailing list