I tested with Eventlet and Gunicorn with Eventlet workers, and both
can be made to work. I loaded the page in two web browsers
concurrently rather than calling from the console, but I think I can
assume that this is immaterial?
Eventlet monkey patching only works if it is called before any imports
The test is easy:
def index():
import time
from gluon import current
print current.request.uuid
sleep(10)
print current.request.uuid
return 'done!'
call this action twice from console within less then 10 seconds from
each other what is the output?
if it looks
A
B
A
B
than
Thanks for the reply.
So what anyserver.py does with gevent is not recommended? It calls
monkey.patch_all() which patches threading to use green threads.
Is this something that ought to work but is just untested? web2py is
pure python so the monkey patching should make thread locals into
greenlet
I am not sure this does not break the new internal web2py design that
uses thread locals.
I would not use async unless we have tested this more.
Massimo
On Jun 22, 6:44 pm, graeme wrote:
> I can see that anyserver.py uses monkey patching to make the standard
> library cooperative with gevent.
>
4 matches
Mail list logo