The detailed information is available in changelog. Below is the summary of all changes since 0.13.8.
Gevent 1.0 supports Python 2.5 - 2.7. The version of greenlet required is 0.3.2. The source distribution now includes the dependencies (libev and c-ares) and has no dependencies other than greenlet.
Now the event loop is using libev instead of libevent (see http://blog.gevent.org/2011/04/28/libev-and-libevent/ for motivation).
The signal handlers set with the standard signal module are no longer blocked by the event loop.
The event loops are now pluggable. The GEVENT_LOOP enviroment variable can specify the alternative class to use (the default is
The error handling is now done by Hub.handle_error().
The system errors that usually kill the process (SystemError, SystemExit, KeyboardInterrupt) are now re-raised in the main greenlet.
sys.exit() when run inside a greenlet is no longer trapped and kills the process as expected.
Two new DNS resolvers: threadpool-based one (enabled by default) and c-ares based one. That threadpool-based resolver was added mostly for Windows and Mac OS X platforms where c-ares might behave differently w.r.t system configuration. On Linux, however, the c-ares based resolver is probably a better choice. To enable c-ares resolver set GEVENT_RESOLVER=ares environment variable.
This fixes some major issues with DNS on 0.13.x, namely:
fork(). You still need to call
os.forkis monkey patched with it if
The following functions were added to socket module:
It is possible to implement your own DNS resolver and make gevent use it. The GEVENT_RESOLVER variable can point to alternative implementation using the format:
package.module.class. The default is
gevent.resolver_thread.Resolver. The alternative “ares” resolver is an alias for
UDP server: gevent.server.DatagramServer
gevent.subprocess implements the interface of the standard subprocess module in a cooperative way.
It is possible to monkey patch the standard subprocess module with
patch_all(subprocess=True) (not done by default).
Warning: this feature is experimental and should be used with care.
gevent.threadpool module provides the usual pool methods (apply, map, imap, etc) but runs passed functions
in a real OS thread.
There’s a default threadpool, available as
GreenletSetwhich used to be alias for
Renamed gevent.coros to gevent.lock. The gevent.coros is still available but deprecated.
In all servers, method “kill” was renamed to “close”. The old name is available as deprecated alias.
Queue(0)is now equivalent to an unbound queue and raises
gevent.queue.Channelif you need a channel.
__nonzero__implementation that returns True after greenlet was started until it’s dead. This overrides greenlet’s __nonzero__ which returned False after start() until it was first switched to.
imap()methods now start yielding the results as soon as possible.
imap_unordered()no longer swallows an exception raised while iterating its argument.
WSGIServernow sets max_accept to 1 if wsgi.multiprocessing is set to True.
monkey.patch_module()function that monkey patches module using __implements__ list provided by gevent module. All of gevent modules that replace stdlib module now have __implements__ attribute.
Next page: Changelog