gevent.core - event loop based on libev

This module is a wrapper around libev and follower the libev API pretty closely. Note, that gevent creates an event loop transparently for the user and runs it in a dedicated greenlet (called hub), so using this module is not necessary. In fact, if you do use it, chances are that your program is not compatible across different gevent version (gevent.core in 0.x has a completely different interface and 2.x will probably have yet another interface).

On Windows, this wrapper will accept Windows handles rather than stdio file descriptors which libev requires. This is to simplify interaction with the rest of the Python, since it requires Windows handles.

The current event loop can be obtained with gevent.get_hub().loop.

events

class loop(flags=None, default=True)

Bases: object

MAXPRI
MINPRI
WatcherType
activecnt
async()
backend
backend_int
break_()
check()
child()
default
depth
destroy()
error_handler
fileno()
fork()
handle_error()
idle()
install_sigchld()
io()
iteration
now()
origflags
origflags_int
pendingcnt
prepare()
ptr
ref()
reinit()
reset_sigchld()
run()
run_callback()
sig_pending
sigfd
signal()
stat()
timer()
unref()
update()
verify()

misc functions

get_version()
get_header_version()
supported_backends()
recommended_backends()
embeddable_backends()
time()

Next page: What’s new in gevent 1.1