Aviad Rozenhek
10/14/2024, 9:38 AMprefect.serve
in my process to reuse the initialization for all flows. however I see that prefect instead of running the flow in my process generates a child process...
if __name__ == "__main__":
load_dotenv()
GLOBAL_OPTIONS.update_options_from_env()
handle_stream_end: prefect.Flow
flows: List[prefect.Flow] = [handle_stream_end] # list of flows this process can handle
deployments = [flow.to_deployment("process_deployment") for flow in flows]
prefect.serve(*deployments) # serve all flows
is this by design?
whats the best way to provide the initialization code for my flows?
is there a way to reuse the initialization across multiple flows?