Paweł Biernat
09/05/2024, 11:05 AMMarvin
09/05/2024, 11:05 AMPaweł Biernat
09/05/2024, 11:06 AMMarvin
09/05/2024, 11:06 AMto_deployment
method. Here's an example from the clueless drones at Prefect:
python
import time
from prefect import flow, serve
@flow
def slow_flow(sleep: int = 60):
"Sleepy flow - sleeps the provided amount of time (in seconds)."
time.sleep(sleep)
@flow
def fast_flow():
"Fastest flow this side of the Mississippi."
return
if __name__ == "__main__":
slow_deploy = slow_flow.to_deployment(name="sleeper", interval=45)
fast_deploy = fast_flow.to_deployment(name="fast")
serve(slow_deploy, fast_deploy)
The name
parameter in the to_deployment
method lets you alias your flow. Happy pretending. Here's the link.
If you need more existential guidance, feel free to ask.Nate
09/05/2024, 3:13 PMname
kwarg that serve
accepts