from typing import AsyncGenerator from sqlalchemy import NullPool from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine from config import settings engine = ...
async def - runs directly on the asyncio event loop -> def - offloaded to a ThreadPoolExecutor via loop.run_in_executor(None, handler) This is intentional. The event loop is single-threaded. Blocking ...