From d43b1a6beb894ef8410d44d567c4752654fdbe76 Mon Sep 17 00:00:00 2001 From: Artur Shiriev Date: Tue, 10 Feb 2026 17:54:36 +0300 Subject: [PATCH] update docs --- docs/dev/decisions.md | 2 +- docs/integrations/fastapi.md | 9 ++++++--- docs/integrations/faststream.md | 3 ++- docs/integrations/litestar.md | 9 ++++++--- mkdocs.yml | 1 + 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/docs/dev/decisions.md b/docs/dev/decisions.md index 09d0de8..f2b6511 100644 --- a/docs/dev/decisions.md +++ b/docs/dev/decisions.md @@ -5,4 +5,4 @@ 4. Focus on maximum type safety: - No need for `# type: ignore` - No need for `typing.cast` -5. No adding new features while tasks can be solved by default implementation. +5. No adding new features while tasks can be solved by current implementation. diff --git a/docs/integrations/fastapi.md b/docs/integrations/fastapi.md index 767cc79..25c5723 100644 --- a/docs/integrations/fastapi.md +++ b/docs/integrations/fastapi.md @@ -99,8 +99,10 @@ async def websocket_endpoint( ) -> None: request_container = session_container.build_child_container(scope=modern_di.Scope.REQUEST) # REQUEST scope is entered here - # You can resolve dependencies here - pass + try: + # You can resolve dependencies here + finally: + await request_container.close_async() await websocket.accept() await websocket.send_text("test") @@ -109,7 +111,8 @@ async def websocket_endpoint( ## Framework Context Objects -Framework-specific context objects like `fastapi.Request` and `fastapi.WebSocket` are automatically made available by the integration. You can reference these context providers in your factories either implicitly through type annotations or explicitly by importing them. +Framework-specific context objects like `fastapi.Request` and `fastapi.WebSocket` are automatically made available by the integration. +You can reference these context providers in your factories either implicitly through type annotations or explicitly by importing them. The following context providers are available for import: - `fastapi_request_provider` - Provides the current `fastapi.Request` object diff --git a/docs/integrations/faststream.md b/docs/integrations/faststream.md index 1600b32..57916e1 100644 --- a/docs/integrations/faststream.md +++ b/docs/integrations/faststream.md @@ -70,7 +70,8 @@ async def read_root( ## Framework Context Objects -Framework-specific context objects like `faststream.StreamMessage` are automatically made available by the integration. You can reference these context providers in your factories either implicitly through type annotations or explicitly by importing them. +Framework-specific context objects like `faststream.StreamMessage` are automatically made available by the integration. +You can reference these context providers in your factories either implicitly through type annotations or explicitly by importing them. The following context provider is available for import: - `faststream_message_provider` - Provides the current `faststream.StreamMessage` object diff --git a/docs/integrations/litestar.md b/docs/integrations/litestar.md index eef69a4..903e628 100644 --- a/docs/integrations/litestar.md +++ b/docs/integrations/litestar.md @@ -90,15 +90,18 @@ async def websocket_handler( ) -> None: request_container = di_container.build_child_container(scope=Scope.REQUEST) # REQUEST scope is entered here - # You can resolve dependencies here - pass + try: + # You can resolve dependencies here + finally: + await request_container.close_async() app.register(websocket_handler) ``` ## Framework Context Objects -Framework-specific context objects like `litestar.Request` and `litestar.WebSocket` are automatically made available by the integration. You can reference these context providers in your factories either implicitly through type annotations or explicitly by importing them. +Framework-specific context objects like `litestar.Request` and `litestar.WebSocket` are automatically made available by the integration. +You can reference these context providers in your factories either implicitly through type annotations or explicitly by importing them. The following context providers are available for import: - `litestar_request_provider` - Provides the current `litestar.Request` object diff --git a/mkdocs.yml b/mkdocs.yml index 80a1f20..e767afc 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -20,6 +20,7 @@ nav: - Migration: - To 1.x: migration/to-1.x.md - To 2.x: migration/to-2.x.md + - From that-depends: migration/from-that-depends.md - Development: - Contributing: dev/contributing.md - Decisions: dev/decisions.md