1
# uwsgi -s :3031 -M -p 4 --plugin gevent --loop gevent --async 1000 --enable-threads -w tests.testgevent
2
from threading import Thread
8
print "i am a gevent task"
10
print "10 seconds elapsed in worker id %d" % wid
15
print "i am the thread 1"
20
print "i am the thread 2"
22
t1 = Thread(target=athread)
26
t2 = Thread(target=athread2)
30
def application(environ, start_response):
33
start_response('200 OK', [('Content-Type','text/html')])
34
yield "sleeping for 3 seconds...<br/>"
37
gevent.spawn(microtask, uwsgi.worker_id())
38
yield "microtask started<br/>"