Sodaman
03/12/2024, 10:38 PMfrom prefect import flow, task, serve
import time
@flow(log_prints=True)
def hello_world(name: str = "world", goodbye: bool = False):
x = 1
s = str(x)
print(f"Hello {name} {s} from Prefect! :hugging_face:")
x += 1
if goodbye:
print(f"Goodbye {name}!")
@flow(log_prints=True)
def slow():
time.sleep(100)
print("ok")
if __name__ == "__main__":
a_deploy = hello_world.to_deployment(name="hellow")
b_deploy = slow.to_deployment(name="slow")
serve(a_deploy, b_deploy)
Nate
03/13/2024, 3:43 AMserve
, what you can do is set a limit
for that process, but that will just limit the number of flow runs that this served process can execute at once, irrespective of which flow(s) is/are being runSodaman
03/13/2024, 1:10 PM