Commit 63f671d1 authored by Denis Bilenko's avatar Denis Bilenko

webpy.py: use time.sleep instead of gevent.sleep

parent 6d8ee5fb
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
from gevent import monkey; monkey.patch_all() from gevent import monkey; monkey.patch_all()
from gevent.pywsgi import WSGIServer from gevent.pywsgi import WSGIServer
import gevent import time
import web import web
urls = ("/", "index", urls = ("/", "index",
...@@ -22,7 +22,7 @@ class long_polling: ...@@ -22,7 +22,7 @@ class long_polling:
# becomes greenlet-local storage thus making requests isolated as they should be. # becomes greenlet-local storage thus making requests isolated as they should be.
def GET(self): def GET(self):
print 'GET /long' print 'GET /long'
gevent.sleep(10) # possible to block the request indefinitely, without harming others time.sleep(10) # possible to block the request indefinitely, without harming others
return 'Hello, 10 seconds later' return 'Hello, 10 seconds later'
if __name__ == "__main__": if __name__ == "__main__":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment