harp.config.applications¶
- class Application[source]¶
Bases:
object
- __init__(*, on_bind=None, on_bound=None, on_ready=None, on_shutdown=None, settings_type=None, dependencies=None)[source]¶
- Parameters:
on_bind (Callable[[OnBindEvent], Awaitable[None]])
on_bound (Callable[[OnBoundEvent], Awaitable[None]])
on_ready (Callable[[OnReadyEvent], Awaitable[None]])
on_shutdown (Callable[[OnShutdownEvent], Awaitable[None]])
settings_type (Type)
- on_bind: Callable[[OnBindEvent], Awaitable[None]] = None¶
Placeholder for factory bind event, happening before the container is built. If set, it will be attached to the factory dispatcher automatically.
- on_bound: Callable[[OnBoundEvent], Awaitable[None]] = None¶
Placeholder for factory bound event, happening after the container is built. If set, it will be attached to the factory dispatcher automatically.
- on_ready: Callable[[OnReadyEvent], Awaitable[None]] = None¶
Placeholder for factory build event, happening after the kernel is built. If set, it will be attached to the factory dispatcher automatically.
- on_shutdown: Callable[[OnShutdownEvent], Awaitable[None]] = None¶
Placeholder for factory dispose event, happening after the kernel is disposed. If set, it will be attached to the factory dispatcher automatically, in reverse order of appearance (first loaded application will be disposed last).
- class ApplicationsRegistry[source]¶
Bases:
object
- get_application(name)[source]¶
Returns the application class for the given application name.
todo: add name/full_name attributes with raise if already set to different value ?
- Parameters:
name (str)
- Returns:
- Return type:
- register_events(dispatcher)[source]¶
- Parameters:
dispatcher (IAsyncEventDispatcher)
- namespaces = ['harp_apps']¶
- applications = {}¶
Cache for applications