ServiceScope
Bases: AbstractAsyncContextManager['ServiceScope'], ABC
Defines a disposable service scope.
The aexit method ends the scope lifetime. Once called, any scoped services that have been resolved from ServiceProvider will be disposed.
service_provider
abstractmethod
property
Gets the :class:BaseServiceProvider used to resolve dependencies from the scope.
get_keyed_service
abstractmethod
async
Get service of type TService or return None.
get_required_keyed_service
abstractmethod
async
Get service of type TService or raise an error.
get_required_service
abstractmethod
async
Get service of type TService or raise :class:NoServiceRegisteredError.