Skip to content

Instantly share code, notes, and snippets.

@kristoff-it
Last active September 18, 2019 13:42
Show Gist options
  • Save kristoff-it/9470cf8e1e8c149645c2f72ee64cc28d to your computer and use it in GitHub Desktop.
Save kristoff-it/9470cf8e1e8c149645c2f72ee64cc28d to your computer and use it in GitHub Desktop.
last_id = '$'
while True:
events = await pool.xread(['wins_stream'], latest_ids=[last_id], timeout=0, count=10)
for _, e_id, e in events:
winner = e['winner']
await add_new_win(pool, winner)
last_id = e_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment