Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # https://bottlepy.org/docs/dev/async.html
- @route('/fetch')
- def fetch():
- body = gevent.queue.Queue()
- worker = SomeAsyncWorker()
- worker.on_data(body.put)
- worker.on_finish(lambda: body.put(StopIteration))
- worker.start()
- return body
Advertisement
Add Comment
Please, Sign In to add comment