On Sun, Sep 14, 2008 at 5:33 PM, Rustam Abdullaev <[EMAIL PROTECTED]> wrote:
Hi,

Is anyone working on a suspendable request support in PHP when used as a
module in Apache?

Suspendable requests are great for supporting Server Push technology, but
are currently only supported in Jetty and Tomcat.

The API would be extremely simple, for example:

suspend(string request_id, int timeout);
- this would end the current request but keep the client connection open up
to "timeout" seconds.

resume(string request_id);
- this would resume a suspended request by starting a new PHP request but
reusing the same client connection that was previously suspended

Two ideas:

First is, for a rough approach that works today: you can emulate this by polling from the suspended process by sleeping for, say, 400ms and checking a shared value for a flag whether to resume.

Second and most important though, Apache isn't architected to handle long running processes inside a request, as it typically uses a limited pool of threads/processes to serve requests, if enough requests in the pool are held up suspended, it would prove heavily detrimental to the server performance (this is why "push" technologies like Comet are not recommended on Apache).

I would possibly suggest the requests communicating with (for example), long running background processes running from shell from that purpose, using standard interprocess communication like unix sockets.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to