Last active
September 18, 2019 13:42
-
-
Save kristoff-it/9470cf8e1e8c149645c2f72ee64cc28d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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