Reputation: 1481
I noticed that gevent supports wrappers for file-like objects: http://www.gevent.org/gevent.fileobject.html
gevent.monkey.patch_all
conveniently patches modules like socket
and time
to make them gevent
friendly. Reading the code, it doesn't seem like patch_all()
calls an explicit patch_file()
but it does call patch_builtins()
. The implementation of this function is somewhat magical. It's not clear to me whether this would patch the built-in file
objects.
Does anyone know?
Upvotes: 0
Views: 431
Reputation: 9122
No, the built in file
is not patched. You need to use gevent
FileObject
.
Upvotes: 1