Created
May 27, 2025 23:03
-
-
Save zzstoatzz/72882c46a2a7d80ba8c4452aa9926651 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import asyncio | |
| from prefect import flow, task | |
| @task | |
| async def sleepy_task() -> None: | |
| await asyncio.sleep(15) | |
| @flow(log_prints=True) | |
| async def sleepy_flow() -> None: | |
| tasks = [sleepy_task.submit() for _ in range(100)] | |
| print("Waiting for all tasks to complete...") | |
| results = [t.result() for t in tasks] | |
| print(f"collected {len(results)} results") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment