how to do asynchronous http requests with epoll and python 3.1
wolfgang.lipp at gmail.com
Wed Mar 24 18:47:22 CET 2010
i asked this question before on
but without a definitive answer as yet.
can someone help me out? i want to do several simple http GET and POST
requests in the same process using Python 3.1 without using threading.
the original post:
there is an interesting page [http://scotdoyle.com/python-epoll-
howto.html] about how to do asnchronous / non-blocking / AIO http
serving in python 3.
there is the [tornado web server] which does include a non-blocking
http client. i have managed to port parts of the server to python 3.1,
but the implementation of the client requires [pyCurl] and [seems
to have problems] (with one participant stating how ‘Libcurl is
such a pain in the neck’, and looking at the incredibly ugly pyCurl
page i doubt pyCurl will arrive in py3+ any time soon).
now that epoll is available in the standard library, it should be
possible to do asynchronous http requests out of the box with python.
i really do not want to use asyncore or whatnot; epoll has a
reputation for being the ideal tool for the task, and it is part of
the python distribution, so using anything but epoll for non-blocking
http is highly counterintuitive (prove me wrong if you feel like it).
oh, and i feel threading is horrible. no threading. i use [stackless]
*people further interested in the topic of asynchronous http should
not miss out on this [talk by peter portante at PyCon2010]; also of
interest is [the keynote], where speaker antonio rodriguez at one
point emphasizes the importance of having up-to-date web technology
libraries right in the standard library.*
More information about the Python-list