How do I use an async function? #1153
-
How do I use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi, "async and await make promises easier to write" async makes a function return a Promise await makes a function wait for a Promise So whenever you are using an Example: |
Beta Was this translation helpful? Give feedback.
I personally find something like this a fairly elegant solution:
The trick is to use something you can synchronously set a flag on and asynchronously wait for that flag to be set, which is something
asyncio.Future
is particularly well-suited for.