Good morning/afternoon all! Feel free to ask away about how to use <.serve()> in thread :point_down:
c
Good morning/afternoon all! Feel free to ask away about how to use

.serve()

in thread 👇
👍 3
sonic 1
g
I have a question, is there a way to create a deployment from python, but then just return from the serve immediately? I'd like to handle my flows with workers instead. That way I can update my deployments whenever I update my flows, but handle the work itself completely separately.
👀 1
a
Great question @GoshDarnedHero! Deployments created with
flow.serve
aren’t associated with a work pool or work queue so their scheduled runs can’t be picked up by workers. You can use
prefect deploy
to create deployments that work with workers. We recommend that approach when you need dynamically provisioned infrastructure for your flow runs. If you don’t need dynamically provisioned infrastructure, you can bake your flow code and serve script into a Docker image to host it on a variety of platforms.
upvote 1
g
Excellent, I do currently deploy via
prefect deploy
so that works for me.