diff --git a/modern_di_faststream/main.py b/modern_di_faststream/main.py index c0eac32..72c4f82 100644 --- a/modern_di_faststream/main.py +++ b/modern_di_faststream/main.py @@ -41,7 +41,7 @@ async def consume_scope( scope=modern_di.Scope.REQUEST, context={faststream.StreamMessage: msg} ) try: - with self.faststream_context.scope("request_container", request_container): + with self.context.scope("request_container", request_container): return typing.cast( typing.AsyncIterator[DecodedMessage], await call_next(msg), @@ -49,10 +49,6 @@ async def consume_scope( finally: await request_container.close_async() - @property - def faststream_context(self) -> faststream.ContextRepo: - return self.context - def fetch_di_container(app_: faststream.FastStream | AsgiFastStream) -> Container: return typing.cast(Container, app_.context.get("di_container"))