Current Async TODOs

I thought I’d keep a topic here that lists the current pieces of work needing to be done on the async views work, both for transparency and also if anyone wants to volunteer to help.

  • Merge async_views branch: Done

  • Make MiddlewareMixin async-aware: Done!

  • Make Signal async-aware: This will allow us to avoid forced sync_to_async calls in the async path for the request_started and request_finished signals

  • Add an async runserver option: The current runserver command uses a WSGI server to work; we should provide an option to run it in ASGI mode (optional so we don’t force Daphne or uvicorn as dependencies of Django)

4 Likes

Hi,
I found this ORM https://github.com/tortoise/tortoise-orm/,

did you already checked it? how do you plan to add async to django orm?

Thanks,
Asif

1 Like

@auvipy I hadn’t seen that - I’ll have to take a look through to see if there’s any inspiration!

The plan for adding async to the ORM is roughly:

  • Add it to the QuerySet/manager layer while keeping the Query/backend in a synchronous threadpool
  • Extend async down into the Query layer and start exploring async-enabled backend options
  • Write a fully-async backend with an async database (likely Postgres) binding
1 Like