Re: [Django] #32172: Adapt signals to allow async handlers

2023-03-08 Thread Django
#32172: Adapt signals to allow async handlers
-+-
 Reporter:  Carlton Gibson   |Owner:  Jon
 |  Janzen
 Type:  New feature  |   Status:  closed
Component:  Core (Other) |  Version:  dev
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  async| Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by GitHub ):

 In [changeset:"9b224579875e30203d079cc2fee83b116d98eb78" 9b224579]:
 {{{
 #!CommitTicketReference repository=""
 revision="9b224579875e30203d079cc2fee83b116d98eb78"
 Refs #32172 -- Used asgiref coroutine shim in async signals tests.

 Bug in e83a88566a71a2353cebc35992c110be0f8628af.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070186c06d0f6c-ce2b9731-a6c7-4b71-abad-f4e35e6719d3-00%40eu-central-1.amazonses.com.


Re: [Django] #32172: Adapt signals to allow async handlers

2023-03-07 Thread Django
#32172: Adapt signals to allow async handlers
-+-
 Reporter:  Carlton Gibson   |Owner:  Jon
 |  Janzen
 Type:  New feature  |   Status:  closed
Component:  Core (Other) |  Version:  dev
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  async| Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"e83a88566a71a2353cebc35992c110be0f8628af" e83a8856]:
 {{{
 #!CommitTicketReference repository=""
 revision="e83a88566a71a2353cebc35992c110be0f8628af"
 Fixed #32172 -- Adapted signals to allow async handlers.

 co-authored-by: kozzztik 
 co-authored-by: Carlton Gibson 
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070186bb2f1c00-a612e765-c992-450d-b082-e49ece0685d5-00%40eu-central-1.amazonses.com.


Re: [Django] #32172: Adapt signals to allow async handlers

2023-03-06 Thread Django
#32172: Adapt signals to allow async handlers
-+-
 Reporter:  Carlton Gibson   |Owner:  Jon
 |  Janzen
 Type:  New feature  |   Status:  assigned
Component:  Core (Other) |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  async| Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * stage:  Accepted => Ready for checkin


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070186bb07df00-1c76d604-41e8-45dd-8af9-6db258299326-00%40eu-central-1.amazonses.com.


Re: [Django] #32172: Adapt signals to allow async handlers

2023-02-28 Thread Django
#32172: Adapt signals to allow async handlers
+--
 Reporter:  Carlton Gibson  |Owner:  Jon Janzen
 Type:  New feature |   Status:  assigned
Component:  Core (Other)|  Version:  dev
 Severity:  Normal  |   Resolution:
 Keywords:  async   | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--
Changes (by Carlton Gibson):

 * has_patch:  0 => 1


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070186974ce360-f51a8676-f31c-4786-9c82-033acb082c5f-00%40eu-central-1.amazonses.com.


Re: [Django] #32172: Adapt signals to allow async handlers

2023-02-28 Thread Django
#32172: Adapt signals to allow async handlers
+--
 Reporter:  Carlton Gibson  |Owner:  Jon Janzen
 Type:  New feature |   Status:  assigned
Component:  Core (Other)|  Version:  dev
 Severity:  Normal  |   Resolution:
 Keywords:  async   | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--

Comment (by Carlton Gibson):

 The [https://github.com/django/django/pull/16547 new PR] looks promising:
 any async receivers are dispatch concurrently.

 I'll (briefly) see if others have capacity to review, otherwise I'd be
 inclined to push it forwards.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070186974c3e22-207610c6-1e88-4ea7-8576-3b41033ad2cb-00%40eu-central-1.amazonses.com.


Re: [Django] #32172: Adapt signals to allow async handlers

2023-02-12 Thread Django
#32172: Adapt signals to allow async handlers
+--
 Reporter:  Carlton Gibson  |Owner:  Jon Janzen
 Type:  New feature |   Status:  assigned
Component:  Core (Other)|  Version:  dev
 Severity:  Normal  |   Resolution:
 Keywords:  async   | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+--
Changes (by Jon Janzen):

 * owner:  Konstantin Volkov => Jon Janzen


Comment:

 [https://github.com/django/django/pull/16547 PR]

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701864704f7cd-33548ac0-9951-4eba-86a8-126044e9ff05-00%40eu-central-1.amazonses.com.


Re: [Django] #32172: Adapt signals to allow async handlers

2023-02-12 Thread Django
#32172: Adapt signals to allow async handlers
-+-
 Reporter:  Carlton Gibson   |Owner:
 |  Konstantin Volkov
 Type:  New feature  |   Status:  assigned
Component:  Core (Other) |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  async| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Jon Janzen):

 Hey Konstantin,

 I'm interested in working on this ticket, would you mind if I claimed it?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070186469e5d64-f748ae16-456d-4b2b-8f89-96561d6fd992-00%40eu-central-1.amazonses.com.


Re: [Django] #32172: Adapt signals to allow async handlers

2023-02-10 Thread Django
#32172: Adapt signals to allow async handlers
-+-
 Reporter:  Carlton Gibson   |Owner:
 |  Konstantin Volkov
 Type:  New feature  |   Status:  assigned
Component:  Core (Other) |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  async| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Jon Janzen):

 * cc: Jon Janzen (added)


Comment:

 I hope I'm not spamming this ticket, but I posted on the Forum about
 asyncifying the auth app which would involve this ticket so I thought it
 would be a good idea to CC the ticket on this issue:
 https://forum.djangoproject.com/t/asyncifying-django-contrib-auth-and-
 signals-and-maybe-sessions/18770

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701863d9f1e86-43f113aa-ae55-4d42-a0f5-7b88a53fc052-00%40eu-central-1.amazonses.com.


Re: [Django] #32172: Adapt signals to allow async handlers

2022-09-13 Thread Django
#32172: Adapt signals to allow async handlers
-+-
 Reporter:  Carlton Gibson   |Owner:
 |  Konstantin Volkov
 Type:  New feature  |   Status:  assigned
Component:  Core (Other) |  Version:  dev
 Severity:  Normal   |   Resolution:
 Keywords:  async| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * needs_better_patch:  1 => 0
 * has_patch:  1 => 0


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701833632b295-3d5ef110-fd0e-492f-a4d6-9daa3a717aea-00%40eu-central-1.amazonses.com.


Re: [Django] #32172: Adapt signals to allow async handlers

2020-11-24 Thread Django
#32172: Adapt signals to allow async handlers
-+-
 Reporter:  Carlton Gibson   |Owner:
 |  Konstantin Volkov
 Type:  New feature  |   Status:  assigned
Component:  Core (Other) |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  async| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * needs_better_patch:  0 => 1
 * stage:  Ready for checkin => Accepted


Comment:

 Performance issues are
 [https://github.com/django/django/pull/13651#issuecomment-731185122 not
 looking good at first glance] — so we need a proper story there to move
 forward. Will mark as PNI whilst we discuss.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.2f7aaf1b3adc662fc0fe6bbeacdc8990%40djangoproject.com.


Re: [Django] #32172: Adapt signals to allow async handlers

2020-11-19 Thread Django
#32172: Adapt signals to allow async handlers
-+-
 Reporter:  Carlton Gibson   |Owner:
 |  Konstantin Volkov
 Type:  New feature  |   Status:  assigned
Component:  Core (Other) |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  async| Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * stage:  Accepted => Ready for checkin


Comment:

 I'm going to mark this RFC — I don't think it's far away.

 We want to do a small amount of profiling before we say the final OK, but
 it can live off the review list for a while during that.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.bf018aa2fa59bfa238859d692ab22ff9%40djangoproject.com.


Re: [Django] #32172: Adapt signals to allow async handlers

2020-11-12 Thread Django
#32172: Adapt signals to allow async handlers
-+-
 Reporter:  Carlton Gibson   |Owner:
 |  Konstantin Volkov
 Type:  New feature  |   Status:  assigned
Component:  Core (Other) |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  async| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * has_patch:  0 => 1


Comment:

 [https://github.com/django/django/pull/13651 PR]

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.ff00aa185321c8f5a1adf12c8fcb30e5%40djangoproject.com.


Re: [Django] #32172: Adapt signals to allow async handlers

2020-11-05 Thread Django
#32172: Adapt signals to allow async handlers
-+-
 Reporter:  Carlton Gibson   |Owner:
 |  Konstantin Volkov
 Type:  New feature  |   Status:  assigned
Component:  Core (Other) |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  async| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Description changed by Carlton Gibson:

Old description:

> Currently (circa 3.1) we have a couple of `sync_to_async()` usages in
> [https://github.com/django/django/blob/009fddc96b88a9aee1232d6a2637f2970fdcfb50/django/core/handlers/asgi.py#L154
> the main line of `ASGIHandler.__call__()`], for the request life cycle
> signals:
>
> {{{
> await sync_to_async(signals.request_started.send,
> thread_sensitive=True)(sender=self.__class__, scope=scope)
> }}}
>
> Much as is done of the middleware,
> [https://github.com/django/django/blob/76181308fb02e67794d0cc1471766a5d7e4c877e/django/core/handlers/base.py#L26
> adapting to accept either synchronous or asynchronous middleware
> classes], it would be good to be able to push that `sync_to_async()` call
> down into the `send()` method, allowing signal handlers to be either sync
> (as now) or async coroutines.
>
> This would give us the option of having a completely async request
> pathway, if we were to remove all synchronous middleware and signal
> handlers.
>
> There will need to be some discussion, perhaps on a PR, or the
> [https://forum.djangoproject.com/c/internals/async/8 Forum's Async
> category] but opening this ticket to track efforts.

New description:

 Currently (circa 3.1) we have a couple of `sync_to_async()` usages in
 
[https://github.com/django/django/blob/009fddc96b88a9aee1232d6a2637f2970fdcfb50/django/core/handlers/asgi.py#L154
 the main line of `ASGIHandler.__call__()`], for the request life cycle
 signals:

 {{{
 await sync_to_async(signals.request_started.send,
 thread_sensitive=True)(sender=self.__class__, scope=scope)
 }}}

 Much as is done of the middleware,
 
[https://github.com/django/django/blob/76181308fb02e67794d0cc1471766a5d7e4c877e/django/core/handlers/base.py#L26
 adapting to accept either synchronous or asynchronous middleware classes],
 it would be good to be able to push that `sync_to_async()` call down into
 the `send()` method, allowing signal handlers to be either sync (as now)
 or async coroutines.

 This would give us the option of having a completely async request
 pathway, if we were to remove all synchronous middleware and signal
 handlers.

 There will need to be some discussion of exact implementation, perhaps on
 a PR, or the [https://forum.djangoproject.com/c/internals/async/8 Forum's
 Async category] but opening this ticket to track efforts.

--

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.3baef27df58ec55e135f63b76cbf84f5%40djangoproject.com.


Re: [Django] #32172: Adapt signals to allow async handlers

2020-11-05 Thread Django
#32172: Adapt signals to allow async handlers
-+-
 Reporter:  Carlton Gibson   |Owner:
 |  Konstantin Volkov
 Type:  New feature  |   Status:  assigned
Component:  Core (Other) |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  async| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * stage:  Unreviewed => Accepted


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.7cd37586b598ddc0d8b9af62ecb364f6%40djangoproject.com.


Re: [Django] #32172: Adapt signals to allow async handlers

2020-11-05 Thread Django
#32172: Adapt signals to allow async handlers
-+-
 Reporter:  Carlton Gibson   |Owner:
 |  Konstantin Volkov
 Type:  New feature  |   Status:  assigned
Component:  Core (Other) |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  async| Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Konstantin Volkov):

 * owner:  nobody => Konstantin Volkov
 * status:  new => assigned


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.8b67563bff12672e83c7810b8be04e6a%40djangoproject.com.


[Django] #32172: Adapt signals to allow async handlers

2020-11-04 Thread Django
#32172: Adapt signals to allow async handlers
--+
   Reporter:  Carlton Gibson  |  Owner:  nobody
   Type:  New feature | Status:  new
  Component:  Core (Other)|Version:  master
   Severity:  Normal  |   Keywords:  async
   Triage Stage:  Unreviewed  |  Has patch:  0
Needs documentation:  0   |Needs tests:  0
Patch needs improvement:  0   |  Easy pickings:  0
  UI/UX:  0   |
--+
 Currently (circa 3.1) we have a couple of `sync_to_async()` usages in
 
[https://github.com/django/django/blob/009fddc96b88a9aee1232d6a2637f2970fdcfb50/django/core/handlers/asgi.py#L154
 the main line of `ASGIHandler.__call__()`], for the request life cycle
 signals:

 {{{
 await sync_to_async(signals.request_started.send,
 thread_sensitive=True)(sender=self.__class__, scope=scope)
 }}}

 Much as is done of the middleware,
 
[https://github.com/django/django/blob/76181308fb02e67794d0cc1471766a5d7e4c877e/django/core/handlers/base.py#L26
 adapting to accept either synchronous or asynchronous middleware classes],
 it would be good to be able to push that `sync_to_async()` call down into
 the `send()` method, allowing signal handlers to be either sync (as now)
 or async coroutines.

 This would give us the option of having a completely async request
 pathway, if we were to remove all synchronous middleware and signal
 handlers.

 There will need to be some discussion, perhaps on a PR, or the
 [https://forum.djangoproject.com/c/internals/async/8 Forum's Async
 category] but opening this ticket to track efforts.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/056.318c8cada31ecefd51d6ca017d1c0bec%40djangoproject.com.