Last active
May 6, 2022 13:51
-
-
Save kvnkho/a9a4e64450eb49af5dacd98273a16ad6 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
| from prefect import flow, task | |
| import time | |
| @task | |
| def add_one(x): | |
| time.sleep(2) | |
| return x+1 | |
| @task | |
| def times_two(x): | |
| return x*2 | |
| @flow | |
| def main(): | |
| for i in range(5): | |
| a = add_one(i).result() | |
| if a > 1: | |
| b = times_two(a) | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment