Skip to content

Instantly share code, notes, and snippets.

@dhensen
Created November 30, 2018 07:28
Show Gist options
  • Save dhensen/f7e6ad763fde345c645cf7530488c04b to your computer and use it in GitHub Desktop.
Save dhensen/f7e6ad763fde345c645cf7530488c04b to your computer and use it in GitHub Desktop.
import asyncio
async def foo():
print('hello')
tasks = [
bar(),
bar(),
bar(),
bar(),
bar(),
bar(),
]
return await asyncio.gather(*tasks)
async def bar():
await asyncio.sleep(1)
print('world')
asyncio.run(foo())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment