betty.service.simple package¶
Submodules¶
Module contents¶
Simple services.
- betty.service.simple.service(factory: Callable[[ServiceProviderT], Awaitable[ServiceT]], /) ServiceManager[ServiceProviderT, ServiceT, ReAwaitable[ServiceT], ReAwaitable[ServiceT], ResolvableAwaitable[ServiceT]]¶
- betty.service.simple.service(factory: Callable[[ServiceProviderT], ServiceT], /) ServiceManager[ServiceProviderT, ServiceT, ServiceT, Callable[[], ServiceT], ServiceT]
Decorate a service factory method.
The factory method is replaced with a
service managerwhich lazily initializes the service when it is accessed.The decorated factory method should return a new service instance.