Ответы пользователя по тегу FastAPI
  • Как FastAPI определяет, что запрос нужно обработать параллельно другим?

    Daemon23RUS
    @Daemon23RUS
    Note: You can mix def and async def in your path operation functions as much as you need and define each one using the best option for you. FastAPI will do the right thing with them.

    Anyway, in any of the cases above, FastAPI will still work asynchronously and be extremely fast.

    But by following the steps above, it will be able to do some performance optimizations.


    Обычный вызов выполняется асинхронно, но если вы указываете асинхронную обработку, то и асинхронность лежит на вас, а у вас там sleep во 2м примере который возвращает промис с задержкой.
    Ответ написан
    Комментировать