You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Within the ModelService class, the "asynchronous" object operations appear to just use the sync_to_async wrapper function provided by Django, while ultimately calling a synchronous Django ORM function.
For example, the get_one_async function calls get_one with sync_to_async:
Asynchronous versions of many of these ORM functions, such as get_object_or_exception are available (aget_object_or_404). Another resource showing async used within core Django features: async queries. Where possible, current use of synchronous ORM functions should be converted to their younger asynchronous counterparts, allowing django-ninja-extra to have proper async support.
The text was updated successfully, but these errors were encountered:
To be fair to you, I have only just learned that all async Django ORM functions are just wrappers for sync_to_async as well, so I'm not sure whether it would be worth going through the effort of using these "async" versions.
Within the
ModelService
class, the "asynchronous" object operations appear to just use thesync_to_async
wrapper function provided by Django, while ultimately calling a synchronous Django ORM function.For example, the
get_one_async
function callsget_one
withsync_to_async
:And
get_one
calls a synchronous in-built Django functionget_object_or_exception
.Asynchronous versions of many of these ORM functions, such as
get_object_or_exception
are available (aget_object_or_404
). Another resource showing async used within core Django features: async queries. Where possible, current use of synchronous ORM functions should be converted to their younger asynchronous counterparts, allowing django-ninja-extra to have proper async support.The text was updated successfully, but these errors were encountered: