Opened 2 years ago
Last modified 6 weeks ago
#34477 assigned New feature
Asyncio send mail backend
Reported by: | Andrew Chen Wang | Owned by: | Ahmed Ibrahim |
---|---|---|---|
Component: | Core (Mail) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Ahmed Ibrahim, Mike Edmunds | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Implementation of asyncio send mail functionality. All methods get its a
prefix variant, and the get_connection runs a start command unlike its sync version.
https://github.com/django/django/pull/16744
Adds Base, Console, and Dummy backends (no test; pending review of draft implementation).
Change History (8)
comment:1 by , 2 years ago
Description: | modified (diff) |
---|---|
Needs documentation: | set |
Needs tests: | set |
comment:2 by , 2 years ago
Owner: | changed from | to
---|---|
Patch needs improvement: | set |
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 2 years ago
Easy pickings: | unset |
---|
comment:4 by , 7 weeks ago
Cc: | added |
---|---|
Has patch: | set |
Needs tests: | unset |
Owner: | changed from | to
Version: | 4.2 → dev |
I will handle this since it became inactive and I think it's a neat feature
comment:5 by , 7 weeks ago
Has patch: | unset |
---|---|
Needs documentation: | unset |
Patch needs improvement: | unset |
follow-up: 8 comment:6 by , 6 weeks ago
Would it be better if I leave the sync implementations as is, and add a new async implementation, because I my mind tells that we can create the async and use the async to create a new sync handler with sync_to_async
so that the logic is only in one place
comment:7 by , 6 weeks ago
Cc: | added |
---|
comment:8 by , 6 weeks ago
Replying to Ahmed Ibrahim:
Would it be better if I leave the sync implementations as is, and add a new async implementation, because I my mind tells that we can create the async and use the async to create a new sync handler with
sync_to_async
so that the logic is only in one place
My instinct is that each EmailBackend should decide for itself whether to implement send_messages()
, asend_messages()
, or both. And then maybe the BaseEmailBackend implementation could sync_to_async
or async_to_sync
if a subclass only provides one of them. (But I'd need to think some more about what happens if an existing sync send method gets asyncified.)
Accepted based on DEP-9.