Skip to content

Commit

Permalink
update coroutines
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Aug 19, 2024
1 parent f6dd539 commit aa3859d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions examples/asyncio/coroutines.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,10 @@ async def sender() -> None:
await asyncio.sleep(1)


asyncio.run(
asyncio.wait(
[
ping(),
receiver(),
sender(),
]
)
)
async def main():
tasks = [asyncio.create_task(coroutine()) for coroutine in [ping, receiver, sender]]
await asyncio.wait(tasks)


if __name__ == "__main__":
asyncio.run(main())

0 comments on commit aa3859d

Please sign in to comment.