Welcome! Log In Create A New Profile

Advanced

Re: Nginx module example with callback

agentzh
June 13, 2012 11:08AM
Hello!

On Wed, Jun 13, 2012 at 7:34 PM, vivek goel <goelvivek2011@gmail.com> wrote:
> I am using a non-blocking library which reads from file-system and calls a
> callback when event has accrued. I want to integrate it with nginx module.
> From where I can find an example where I can send response from third party
> library callback?
>

The key here is to let nginx monitor the events for your library here
because there has to be one single event loop in the nginx worker
process. So your library cannot take the control and run its own event
loop because it will certainly block the nginx worker.

You can take a look at the ngx_drizzle and ngx_postgres modules:

http://wiki.nginx.org/HttpDrizzleModule
https://github.com/FRiCKLE/ngx_postgres

Both of them integrate nonblocking libraries (libdrizzle and libpq)
into the nginx event model. And for ngx_drizzle, it bypasses the
"poll" calls in libdrizzle to prevent conflicts.

Best regards,
-agentzh

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Nginx module example with callback

goelviek2011@gmail.com 1354 June 13, 2012 07:36AM

Re: Nginx module example with callback

agentzh 650 June 13, 2012 11:08AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 236
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