BaseServiceProvider
Bases: KeyedServiceProvider, ServiceScopeFactory, ABC
Define a mechanism for retrieving a service object; that is, an object that provides custom support to other objects.
create_scope
abstractmethod
Create a :class:ServiceScope that contains a :class:ServiceProvider used to resolve dependencies from a newly created scope.
get_keyed_service
async
Get service of type TService or return None.
get_keyed_services
async
get_keyed_services(
service_key: object | None, service_type: type[TService]
) -> Sequence[TService]
Get all services of type TService.
get_required_keyed_service
async
Get service of type TService or raise an error.
get_required_service
async
Get service of type TService or raise :class:NoServiceRegisteredError.
get_service
async
Get service of type TService or return None.