[dev][mod_wsgi] asynchronous extensions
manlio_perillo at libero.it
Mon Mar 3 17:46:44 MSK 2008
Its time to add asynchronous extensions to the WSGI module.
I'm developing a WSGI application where I need to talk with a web
service on the Internet, so it is *very* important to use an
asynchronous HTTP client.
I have choose libcurl, since it is well designed and there is a wrapper
Here is what I'm thinking to do:
1) when libcurl creates a socket, I create an associated nginx
connection, by calling the ngx_get_connection function
2) when I need a read notifycation, I call ngx_handle_read_event
3) when I need a read notifycation, I call ngx_handle_write_event
4) when I'm done with libcurl, I call ngx_close_connection
Of course I have to setup the timeouts, but is this all I need to do?
The event structure has a lot of members, and I'm not sure to understand
all of them.
Also, there is a problem with ngx_close_connetion: it will close the
socket, but the socket is owned by libcurl, so I will need to patch it.
Thanks Manlio Perillo
More information about the nginx