-
My setup: A driver process is listening for events and then invoking the flow: Issue: Question: Idea: @flow
def my_flow(task_runner=ThreadPoolTaskRunner(max_workers=3)):
"""Streaming flow that continuously checks for work."""
while True:
work = check_for_work()
if work:
my_task.submit(work) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
hi @Pballer
this is a major reason we added background tasks (advanced example)! the big difference is that task workers are websocket clients, so you don't have to wait for the poll interval to find the scheduled runs, task workers will pick up published runs almost immediately. like normal, you can call tasks or flows from these tasks that you're serving. so its a way to have stuff run quickly on static infra instead of having a polling worker that submits a request for infra to spin up |
Beta Was this translation helpful? Give feedback.
hi @Pballer
this is a major reason we added background tasks (advanced example)!
the big difference is that task workers are websocket clients, so you don't have to wait for the poll interval to find the scheduled runs, task workers will pick up published runs almost immediately. like normal, you can call tasks or flows from these tasks that you're serving. so its a way to have stuff run quickly on static infra instead of having a polling worker that submits a request for infra to spin up