Event-driven handler

Marcus Clyne eugaia at gmail.com
Wed Feb 18 02:30:18 MSK 2009


Hi,

I'm trying to develop a handler for Nginx.  I want to do this:

(1) Request comes in to Nginx
(2) This is passed on to handler
(3) Handler sends request to other code (either a new thread or some
event-driven system) and tells Nginx to wait until output has been generated
(4) Output is generated in 'background' whilst Nginx is handling other requests
(5) Message is sent to Nginx that content has been generated through some event
(e.g. with a semaphore)
(6) Nginx retrieves content and sends to client

I already have a handler that does 1,2, 4 (not in background though) and 6 -
it's the 3, 4 (in background) and 5 that I don't know how to do yet. My current
implementation is a blocking one, which I don't want.

Could anyone please give me a simple example of how to do this, or at least tell
me which functions I need to use?

Thanks.







More information about the nginx mailing list