concurrent.futures
backend
#17
Replies: 3 comments 4 replies
-
I would rather we don’t offer such an option, since it will not provide any reliability in the case of process crashes. Let’s make the database backend the preferred/promoted path. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure of the technical merits of this, but I'd love the idea of a "ThreadBackend". My use-case is the simple (and common) case of sending an email in the background. I don't need to wait for the result, and sending emails is inherently unreliable anyway. Changing my app to need an additional worker process and database tables, feels like unnecessary complexity. I did manage to achieve what I wanted by using an async view that calls an async function that sends the email using httpx and a REST API. But this also introduces complexities with needing to change the webserver and potentially breaking whitenoise and other stuff. |
Beta Was this translation helpful? Give feedback.
-
In my searching for a solution, I came across this: https://github.com/morlandi/django-task That appeared to offer what I wanted, but hasn't been updated in a while, lacked documentation, and I couldn't get it working. I'm not qualified to comment on the technical merits of these solutions. I'm just after a way to send an email in the background without having to run separate worker processes. |
Beta Was this translation helpful? Give feedback.
-
Python already has a form of concurrent tasks queue built in:
concurrent.futures
. Perhaps a simple backend based on this would be useful? It would likely be limiting, but for incredibly small deployments it would provide an intermediary betweenImmediateBackend
andDatabaseBackend
.Beta Was this translation helpful? Give feedback.
All reactions