Do all of the default monkey patching (calls every other function in this module.
Replace the standard socket object with gevent’s cooperative sockets.
If dns is true, also patch dns functions in socket.
Replace os.fork() with gevent.fork(). Does nothing if fork is not available.
Replace time.sleep() with gevent.sleep().
Replace select.select() with gevent.select.select().
If aggressive is true (the default), also remove other blocking functions the select.
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.
Patch sys.std[in,out,err] to use a cooperative IO via a threadpool.
This is relatively dangerous and can have unintended consequences such as hanging the process or misinterpreting control keys.
This method does nothing on Python 3. The Python 3 interpreter wants to flush the TextIOWrapper objects that make up stderr/stdout at shutdown time, but using a threadpool at that time leads to a hang.
Next page: gevent.core - event loop based on libev