1 message in ru.sysoev.nginx[dev] ngx.poll extension for mod_wsgi
FromSent OnAttachments
Manlio PerilloMar 26, 2008 12:37 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[dev] ngx.poll extension for mod_wsgiActions...
From:Manlio Perillo (manl@public.gmane.org)
Date:Mar 26, 2008 12:37:18 pm
List:ru.sysoev.nginx

Hi.

For people interested I have designed and implemented an extension for my WSGI module for Nginx for better support of asynchronous applications.

Here are some examples:

1) An example of asynchronous query to a PostgreSQL database: http://hg.mperillo.ath.cx/nginx/mod_wsgi/file/tip/examples/nginx-postgres-async.py

The example make use of a connection pool that can grow indefinitely.

2) An example of HTTP proxy using pycurl: http://hg.mperillo.ath.cx/nginx/mod_wsgi/file/tip/examples/nginx-curl.py

3) A very simple example on how to split a long calculation: http://hg.mperillo.ath.cx/nginx/mod_wsgi/file/tip/examples/nginx-hash-async.py

4) A very simple example of asynchronous HTTP request http://hg.mperillo.ath.cx/nginx/mod_wsgi/file/tip/examples/nginx-poll-sleep.py

The application just "sleeps" for fixed amount of times until the request is done.

There are still problems and possible bugs. I would really appreciate any suggestions about the API design; unfortunately people on the Python web-sig mailing list are not very interested in supporting asynchronous applications...

NOTE: the extension does not works with the rtsig event module, a segmentation fault occur.

The problem is that I simply make use of add_event and del_event, and the rtisig module does not defines these two operations (the add_event function pointer is NULL).