Skip to content

Commit

Permalink
Merge pull request #570 from FedericoCeratto/patch-3
Browse files Browse the repository at this point in the history
Use gevent.sleep instead of time.sleep
  • Loading branch information
defnull committed Feb 7, 2014
2 parents 69b481f + 619a010 commit f6fc25c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@ Several "push" mechanisms like XHR multipart need the ability to write response

from gevent import monkey; monkey.patch_all()

import time
import gevent
from bottle import route, run
@route('/stream')
def stream():
yield 'START'
time.sleep(3)
gevent.sleep(3)
yield 'MIDDLE'
time.sleep(5)
gevent.sleep(5)
yield 'END'
run(host='0.0.0.0', port=8080, server='gevent')
Expand Down

0 comments on commit f6fc25c

Please sign in to comment.