|
|
|
|
|
by tiangolo
1966 days ago
|
|
I'm glad FastAPI is useful! And thanks to InvestSuite for being one of the FastAPI gold sponsors. If you are having problems, you can ask in GitHub issues. But for the async stuff, a simple rule of thumb is to always use normal def functions and blocking (non async) libraries, that way FastAPI will do the right thing and make sure to run it in a threadpool (thanks to Starlette, the underlying library). And for the specific path operations (endpoints) where you need to optimize performance, then you can use async and carefully choose async libraries, or run the blocking code with run_in_threadpool, but you can leave those details and possible extra complexity for the cases that actually need the extra performance or async support. |
|
I understand that fastapi is more suited for async stuff for which it truly works great, but it would be nice if there was a idiomatic solution within fastapi and/or starlette that prevents these kind of problems.
Great work otherwise!