betty.services.simple package#

Submodules#

Module contents#

Simple services.

betty.services.simple.service(factory: Callable[[ServiceProviderT], Awaitable[ServiceT]], /) ServiceManager[ServiceProviderT, ServiceT, ReAwaitable[ServiceT], ReAwaitable[ServiceT], ResolvableAwaitable[ServiceT]]#
betty.services.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 manager which lazily initializes the service when it is accessed.

The decorated factory method should return a new service instance.