Skip to content

Instantly share code, notes, and snippets.

@mturoci
Created September 20, 2022 16:09
Show Gist options
  • Save mturoci/9678af54c18565111182d6c2827b9ed8 to your computer and use it in GitHub Desktop.
Save mturoci/9678af54c18565111182d6c2827b9ed8 to your computer and use it in GitHub Desktop.
async def polling_function(q: Q):
count = 0
total = 20
while count < total:
# You would make an async HTTP call here in real-world to get the fresh data.
await q.sleep(1)
count +=1
q.page['meta'].dialog.items[0].progress.value = count / total
await q.page.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment