Adding custom events to nginx request handler

1.1k Views Asked by At

Hi Is there a way to break the nginx module request handler into phases to simulate async behavior for third party library used in custom module? Say I have a library that talks to another server and this library internally manages connections and request processing with backend server. nginx wont be able to generate events on the underlying connections. So approach I can think of is, the nginx handler creates a thread to run the blocking operation and at this point I want to return the control to nginx so it can proceed. Now when the library API call returns I want to post an event in nginx event loop so that it can resume the handler and send back the response to client.

I guess this should be possible? Any pointers on how?

Thanks in advance,

0

There are 0 best solutions below