Replies: 1 comment 3 replies
-
I don't think this is what Starlette's background tasks are meant for. Try taking control of the event loop and running your own async tasks. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If I have a list of Callable Async tasks and I wish to run them in a background and also restart them after a duration period, how can I design this?
Using the framework FastAPI I tried to code this toy example but as far as I understood, the BackgroundTasks list is run not concurrently but in a FIFO order. How can I fix this example or design this alternatively in a simple and elegant manner?
I wish to replace some legacy code base where there were a huge codebase dedicated to define custome Thread/Daemon objects with background/periodic properties but I feel like it was not consistent and it was overcomplex too.
Beta Was this translation helpful? Give feedback.
All reactions