Closed
Description
eg, I'd like to be able to run background tasks and pool http connections:
@contextlib.asynccontextmanager
async def lifespan_context():
async with anyio.create_task_group() as tg, httpx.AsyncClient() as client:
yield {"tg": tg, "client": client}
app = Server("name", lifespan_context=lifespan_context)
anything yielded from the context manager should be available on app.request_context.state