- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for ContextVar (0.06 sec)
-
tests/test_dependency_contextvars.py
from contextvars import ContextVar from typing import Any, Awaitable, Callable, Dict, Optional from fastapi import Depends, FastAPI, Request, Response from fastapi.testclient import TestClient legacy_request_state_context_var: ContextVar[Optional[Dict[str, Any]]] = ContextVar( "legacy_request_state_context_var", default=None ) app = FastAPI() async def set_up_request_state_dependency(): request_state = {"user": "deadpond"}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Feb 17 12:40:12 UTC 2022 - 1.5K bytes - Viewed (0) -
docs/en/docs/release-notes.md
For example, this works correctly now: ```Python from contextvars import ContextVar from typing import Any, Dict, Optional legacy_request_state_context_var: ContextVar[Optional[Dict[str, Any]]] = ContextVar( "legacy_request_state_context_var", default=None ) async def set_up_request_state_dependency():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Nov 01 11:25:57 UTC 2024 - 460.3K bytes - Viewed (0)