Async not used #2120
|
The template does not use async at all. Is there any particular reason for that? Do celery, sqlalchemy etc work with async? |
Replies: 6 comments
|
I was trying to find out that info. So no asyncpg? |
|
I couldn't find a way to use sqlalchemy with async-await for my previous project so I decided to use the Databases package |
|
For database async application, tortoise-orm is fine too. |
|
sqlalchemy 1.4 enables async use of the ORM |
|
I had similar/related doubts (why the examples were using blocking operations) and I was missing some background information that I found reading this comment and the technical details in the fastapi documentation But particularly for your question you should find your answer here: |
|
The simplest is to start without async, and add async to the code paths that need it, but that requires careful handling to make sure the libraries used internally are compatible with async, or are properly wrapped with, for example, Asyncer. |
The simplest is to start without async, and add async to the code paths that need it, but that requires careful handling to make sure the libraries used internally are compatible with async, or are properly wrapped with, for example, Asyncer.