Nicolas George schrieb: > Hi. > > There is an increasingly popular technique to emulate server-initiated push > over HTTP. I'm sure everyone here knows it well, but for the sake of > completeness: the clients sends a XMLHttpRequest to the server in the > background; the server does not answer it immediately, but keeps it for > later when there is actually something to say to the client; if the request > timeouts, the client re-sends it. > > I am wondering if this technique is usable with Apache in general and > mod_perl in particular. > > The obvious solution is to have the request handler sleep until it has > something to answer does not work, since it requires a worker thread and a > perl interpreter for each waiting client, and perl interpreters are few and > expensive. > > The ideal solution would be if some part of the request handler could put > the current request (A) "on hold". Later, the handler for another request > (B) could retrieve the request A and generate an answer for it, or at least > wake it up. >
What you describe here is called Continuations in Java world :-) Tom http://docs.codehaus.org/display/JETTY/Continuations