Guest User

Untitled

a guest
Feb 21st, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. @app.route()
  2. def events():
  3. def gen():
  4. while True:
  5. yield "data: {0}nn".format(random.randint(0, 1000))
  6. return Response(gen(), mimetype="text/event-stream")
Add Comment
Please, Sign In to add comment