Replies: 1 comment
-
Hey again @mjarosie! You could use FastAPI's background task functionality to run these dynamically generated tasks, but I think that would generally be less durable than using I think it's worth asking why you need to generate tasks dynamically. Could you instead accept arguments to your tasks and handle the dynamic aspects via logic within your task? I'm not sure if that will work with your use case, but that approach could simplify your implementation. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Hi,
I'm trying to implement a service that builds long-running flows/tasks dynamically and invokes them asynchronously. Here's a very simplified version of my service (based on "How to deploy a web application powered by background tasks"):
I'd like the flow/task to be run asynchronously (i.e.
POST /submit
to return almost immediately) and get a result eventually, possibly retrieving it via another, follow-up API call.Based on my requirements and the docs linked above I figured I should use
.delay()
. But the issue is - for the task to be picked up by a worker, it needs to be aware of the implementation of the task, so that it canserve()
it. That seems to be a blocker - I couldn't find a way to make it work. Is there an alternative approach to make it work?Beta Was this translation helpful? Give feedback.
All reactions