__file__
properly.subprocess=True
is passed.get_hub(default=True)
. Patch by Jan-Philip Gehrcke.__init__
, so that it’s
possible to have module-global locks without initializing the hub.
This fixes monkey.patch_all() not to init the hub.monkey:
socket:
pywsgi:
subprocess:
resolver_ares:
os:
hub:
core:
Misc:
ref=False
.Major and backward-incompatible changes:
core:
Misc:
Examples:
Developer utilities:
Backward-incompatible changes:
Release highlights:
misc:
ares.pyx:
pywsgi:
core:
resolver_ares:
socket:
monkey:
backdoor:
servers:
coros:
Added ‘ref’ property to all watchers. Settings it to False make watcher call ev_unref/ev_ref appropriately so that this watcher does not prevent loop.run()/hub.join()/run() from exiting. Made resolver_ares.Resolver use ‘ref’ property for internal watcher.
In all servers, method “kill” was renamed to “close”. The old name is available as deprecated alias.
Added a few properties to the loop: backend_fd, fdchangecnt, timercnt.
Upgraded c-ares to 1.7.5+patch.
Fixed getaddrinfo to return results in the order (::1, IPv4, IPv6).
Fixed getaddrinfo() to handle integer of string type. Thanks to kconor.
Fixed gethostbyname() to handle ‘’ (empty string).
Fixed getaddrinfo() to convert UnicodeEncodeError into error(‘Int or String expected’).
Fixed getaddrinfo() to uses the lowest 16 bits of passed port integer similar to built-in _socket.
Fixed getnameinfo() to call getaddrinfo() to process arguments similar to built-in _socket.
Fixed gethostbyaddr() to use getaddrinfo() to process arguments.
version_info is now a 5-tuple.
Added handle_system_error() method to Hub (used internally).
Fixed Hub’s run() method to never exit. This prevent inappropriate switches into parent greenlet.
Fixed Hub.join() to return True if Hub was already dead.
Added ‘event’ argument to Hub.join().
Added run()
function to gevent top level package.
Fixed Greenlet.start() to exit silently if greenlet was already
started rather than raising AssertionError
.
Fixed Greenlet.start() not to schedule another switch if greenlet is already dead.
Fixed gevent.signal() to spawn Greenlet instead of raw greenlet. Also it’ll switch into the new greenlet immediately instead of scheduling additional callback.
Do monkey patch create_connection() as gevent’s version works better with gevent.socket.socket than the standard create_connection.
pywsgi: make sure we don’t try to read more requests if socket operation failed with EPIPE
pywsgi: if we failed to send the reply, change ‘status’ to socket error so that the logs mention the error.
Fixed a bug in gevent.queue.Channel class. (Thanks to Alexey Borzenkov)
Backward-incompatible changes:
Queue(0)
is now equivalent to an unbound queue and raises
DeprecationError
. Use gevent.queue.Channel
if you
need a channel.Greenlet.link()
, Greenlet.link_value()
and
Greenlet.link_exception()
.gevent.core
has been rewritten and the interface is
not compatible.SystemExit
and SystemError
now kill the whole process
instead of printing a traceback.util.lazy_property
property.gevent.dns
module.GreenletSet
which used to be alias for
Group
.gevent.wsgi
is now a deprecated alias for gevent.pywsgi
.Release highlights:
gevent.core
module now wraps libev’s API and is not
compatible with gevent 0.x.signal
works now as expected.Hub.handle_error
function.gevent.queue.Channel
class to gevent.queue
module. It is
equivalent to Queue(0)
in gevent 0.x, which is deprecated now.peek
to gevent.queue.Queue
class.idle
function which blocks until the event loop is idle.Hub.join
.gevent.ares
C extension which wraps c-ares
and
provides asynchronous DNS resolver.gevent.resolver_ares
module provides synchronous
API on top of gevent.ares
.The gevent.socket
module:
fork()
. You
still need to call gevent.fork()
(os.fork
is monkey
patched with it if monkey.patch_all()
was called)./etc/resolv.conf
and /etc/hosts
.The gevent.hub.Hub
object:
join
method which waits until the event loop exits or optional timeout expires.wait
method which waits until a watcher has got an event.handle_error
method which is called by all of gevent in case of unhandled exception.print_exception
method which is called by handle_error
to print the exception traceback.The Greenlet
objects:
__nonzero__
implementation that returns True
after
greenlet was started until it’s dead. Previously greenlet was
False
after start()
until it was first switched to.The gevent.pool
module:
map
and imap
methods now start yielding the
results as soon as possible.imap_unordered
no longer swallows an exception raised
while iterating its argument.Miscellaneous:
gevent.sleep(<negative value>)
no longer raises an exception,
instead it does sleep(0)
.clear
to internal Waiter
class.wait
method from internal Waiter
class.WSGIServer
now sets max_accept
to 1 if
wsgi.multiprocessing
is set to True`
gevent.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: Changes before gevent 1.0