I also understand that the heavy lifting in async_to_sync and sync_to_async 
wrapper has been implemented 
<https://docs.djangoproject.com/en/4.2/topics/async/#async-to-sync> and the 
hard work like thread affinity is managed by these wrapper.


Switching between sync and async context is not free, it can cause a 
significant performance degradation. As far as I'm aware, using 
async_to_sync/sync_to_async wrappers is a temporary solution to provide an 
async interface when we don't have all async elements ready.

Best,
Mariusz

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/3fc1d122-94e5-4e58-a824-8ad1235399acn%40googlegroups.com.
  • Syn... Olivier Tabone
    • ... Jon Janzen
      • ... Lufafa Joshua
        • ... Olivier Tabone
      • ... Olivier Tabone
        • ... Mariusz Felisiak
          • ... 'Adam Johnson' via Django developers (Contributions to Django itself)

Reply via email to