How to make asynchronous http requests with epoll and python 3.1

UPDATE: after a lot of work with Py3, including recording my own asynchronous web server (after the presentation presented by Dave Beasley), I finally dumped Python (and a huge stack of my code) -: CoffeeScript works in favor of NodeJS . Check this out: GitHub (where today you'll find 95% of all the interesting code), npm (a package manager that might not be user-friendly, good speed easy_install, you never lived up to your name), an insanely huge repository of modules (with lots new materials that are published almost 24/7), a huge and vibrant community, ready-made asynchronous HTTP and file processing ... all this (thanks to V8 ) at the third speed of light- what do not like? read more agitation: "The Future of Scripts" (slide hosting courtesy of SpreeWebdesign ).

there is an interesting page http://scotdoyle.com/python-epoll-howto.html on how to do asynchronous / non-blocking / AIO http service in python 3.

There is a tornado web server that includes a non-blocking http client. I managed to migrate the server parts to python 3.1, but client implementation requires pyCurl and seems to have problems (one participant stated that "Libcurl is such a pain in the neck, and looking at the incredibly ugly pyCurl page, I doubt that pyCurl will arrive in py3 + any time soon).

now that epoll is available in the standard library, it should be possible to make asynchronous HTTP requests out of the box using python. I really do not want to use asyncore or whatnot; epoll has a reputation for being the perfect tool for this task, and it is part of the python distribution, so using anything other than epoll for non-blocking HTTP is very controversial (prove that I'm wrong if you want to).

oh and i feel the thread is terrible. no threads. I am using stackless .

, http, peter portante PyCon2010; , antonio rodriguez - - .

edit . , , ( , , ); , skipfish google, , : , skipfish

, / , IPC , .

+3
4

, ,

epoll() (asyncore poll(), epoll()), .

, , : asyncore ( python - , , , stdlib ; -).

0

FWIW, : http://github.com/mnot/nbhttp/

redbot.org.

Python 3, .

,

0
0

Python 3 . , , , , python 3 ?

-2

Source: https://habr.com/ru/post/1737974/


All Articles