Browse Source

docs: add docstring to contextmanager_in_threadpool

Add missing docstring to the contextmanager_in_threadpool utility
function in fastapi/concurrency.py.
pull/15922/head
Tono Developer 3 weeks ago
parent
commit
3527f22572
  1. 8
      fastapi/concurrency.py

8
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

Loading…
Cancel
Save