Igor Sysoev ha scritto:
On Wed, Oct 24, 2007 at 08:22:52AM -0700, Steve Chu wrote:
I mean, why mod_perl not blocked?
As it was already said, ngx_http_perl_module of course blocks too.
However, ngx_http_perl_module allows to create call-back handlers
that will be called lately. Currently ngx_http_perl_module support
two such handlers only:
$r->has_request_body(handler)
and
$r->sleep(milliseconds, handler)
Use of $r->has_request_body() you may see here:
http://wiki.codemongers.com/NginxEmbeddedPerlModule
mod_wsgi has a similar feature.
If there is a request body, the handler is called only after the entire
body has been read.
Moreover Python supports generators:
http://en.wikipedia.org/wiki/Generator_%28computer_science%29
This means that the iteration can be suspended when nginx is busy
sending data.
In a future revision I will had an extension, so that the WSGI
application can voluntarily suspend its execution.