betty.core module¶
Provide tools to build core application components.
- class betty.core.Bootstrapped[source]¶
Bases:
object
A component that can be in a bootstrapped state.
This is internal. It MAY be used anywhere in Betty’s source code, but MUST NOT be used by third-party code.
- class betty.core.CoreComponent[source]¶
Bases:
Bootstrapped
,Shutdownable
,ABC
A core component.
Core components can manage their resources by being bootstrapped and shut down.
This is internal. It MAY be used anywhere in Betty’s source code, but MUST NOT be used by third-party code.
- class betty.core.ShutdownCallbackKwargs[source]¶
Bases:
TypedDict
The keyword arguments to a shutdown callback.
- final class betty.core.ShutdownStack[source]¶
Bases:
Bootstrapped
,Shutdownable
A stack that invokes callbacks in reverse order upon shutting down.
This is internal. It MAY be used anywhere in Betty’s source code, but MUST NOT be used by third-party code.
- append(callback: Callable[[Unpack[ShutdownCallbackKwargs]], Awaitable[None]] | Shutdownable) None [source]¶
Append a callback or another component to the stack.