Prefect worker as a thread with in the app process #17650
Unanswered
navya-sammeta
asked this question in
General
Replies: 1 comment 1 reply
-
|
hi @navya-sammeta - have you checked out from prefect import flow
@flow
def foo(): ...
if __name__ == "__main__":
foo.serve(cron='* * * * *') # this will listen for scheduled runs of this flow and execute them |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Prefect needs the worker to execute the task. It's additional orchestration, and deployment complexity. Is it possibel to run the workers within another app with a thread pool instantiated?
Basically, Imagine, Django/fast-api invoking a background task, but the worker itself is included within the django app with it's own thread pool. So, One of the django nodes/pods will pick the task and execute it.
Beta Was this translation helpful? Give feedback.
All reactions