Welcome! Log In Create A New Profile

Advanced

how to write non-blocking content handler?

Posted by melon1234 
how to write non-blocking content handler?
August 07, 2012 10:51PM
Dear,

I've built a nginx module (simply hooks the content handler) to receive client request, do calculation, send response. Intuitively, I expect nginx to create thread for each incoming request, and process requests in parallel. However, if "do calculation" part takes long time ( eg: sleep(10) ), incoming request will be consumed one by one in serial. Since nginx is event-driven rather than threading, I think there would be some way to write non-blocking content handler. Could you please give me some hints? Is there any document / example related to this topic? Thank you in advance.

--
ShenLei
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 103
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready