gevent.monkey – Make the standard library cooperative

gevent.monkey.patch_all(socket=True, dns=True, time=True, select=True, thread=True, os=True, ssl=True, httplib=False, subprocess=False, sys=False, aggressive=True, Event=False)

Do all of the default monkey patching (calls every other function in this module.

gevent.monkey.patch_socket(dns=True, aggressive=True)

Replace the standard socket object with gevent’s cooperative sockets.

If dns is true, also patch dns functions in socket.

gevent.monkey.patch_ssl()
gevent.monkey.patch_os()

Replace os.fork() with gevent.fork(). Does nothing if fork is not available.

gevent.monkey.patch_time()

Replace time.sleep() with gevent.sleep().

gevent.monkey.patch_select(aggressive=True)

Replace select.select() with gevent.select.select().

If aggressive is true (the default), also remove other blocking functions the select.

gevent.monkey.patch_thread(threading=True, _threading_local=True, Event=False)

Replace the standard thread module to make it greenlet-based. If threading is true (the default), also patch threading. If _threading_local is true (the default), also patch _threading_local.local.

gevent.monkey.patch_subprocess()
gevent.monkey.patch_sys(stdin=True, stdout=True, stderr=True)

Next page: gevent.core - event loop based on libev