Great article. I was not aware of concurrent.futures in standard library.
I use gevent in Python 2 for light-weight threads. It uses green threads under the hood. The API is very simple to use. If you have a lot of IO bound tasks, e.g downloading over 100 files / making a lot of requests concurrently, this library is very useful.
Great article. I was not aware of concurrent.futures in standard library.
I don't think you're the first one, the various "what's new in Python" contain a lot of gems over the years ;)
I use gevent in Python 2 for light-weight threads. It uses green threads under the hood. The API is very simple to use. If you have a lot of IO bound tasks, e.g downloading over 100 files / making a lot of requests concurrently, this library is very useful.
Yeah gevent is nice though I've never been a huge fan of cooperative multi tasking as a concurrency paradigm. It's true as you say that for I/O bound tasks has it uses though.
The objective of the post was to uncover a hidden gem in the standard library. Regarding async I/O you might want to take a look at asyncio in the standard library (Python 3's) and uvloop outside the library!
Great article. I was not aware of
concurrent.futures
in standard library.I use
gevent
in Python 2 for light-weight threads. It uses green threads under the hood. The API is very simple to use. If you have a lot of IO bound tasks, e.g downloading over 100 files / making a lot of requests concurrently, this library is very useful.I don't think you're the first one, the various "what's new in Python" contain a lot of gems over the years ;)
Yeah gevent is nice though I've never been a huge fan of cooperative multi tasking as a concurrency paradigm. It's true as you say that for I/O bound tasks has it uses though.
The objective of the post was to uncover a hidden gem in the standard library. Regarding async I/O you might want to take a look at asyncio in the standard library (Python 3's) and uvloop outside the library!
uvloop
is excellent! I have used it for Python 3 based web-services.Nice! You should make a post about it!
:-)
All in due time :)
I agree, have a look at asyncio, that seems to be the future. Better to say it's already the present!