Created
July 20, 2022 22:38
-
-
Save khuyentran1401/25d66a9733972f9752a5c841c9b9764f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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