diff --git a/fastapi/concurrency.py b/fastapi/concurrency.py index 76a5a2eb1..281647b80 100644 --- a/fastapi/concurrency.py +++ b/fastapi/concurrency.py @@ -16,6 +16,14 @@ _T = TypeVar("_T") @asynccontextmanager async def contextmanager_in_threadpool( + """Run a context manager in a thread pool. + + Args: + cm: The context manager to run. + + Returns: + The result of the context manager. + """ cm: AbstractContextManager[_T], ) -> AsyncGenerator[_T, None]: # blocking __exit__ from running waiting on a free thread