Skip to content

Instantly share code, notes, and snippets.

@khuyentran1401
Created July 20, 2022 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khuyentran1401/25d66a9733972f9752a5c841c9b9764f to your computer and use it in GitHub Desktop.
Save khuyentran1401/25d66a9733972f9752a5c841c9b9764f to your computer and use it in GitHub Desktop.
# This is Prefect 2.0b9
import asyncio
from prefect import flow, task
@task
async def shout(number):
asyncio.sleep(1)
print(f"#{number}")
@flow()
async def count_to(highest_number):
for number in range(highest_number):
await shout(number)
asyncio.run(count_to(3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment