harp.config.applications

Inheritance diagram of 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:
defaults()[source]
normalize(settings)[source]
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).

path: str | None = None

A placeholder for the source path of the application.

settings_type: Type = None

Type definition for configuration parsing.

class ApplicationsRegistry[source]

Bases: object

__init__(*, namespaces=None)[source]
Parameters:

namespaces (list[str] | None)

add(*names)[source]
aslist()[source]
defaults()[source]
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:

Application

items()[source]
Return type:

ItemsView[str, Application]

keys()[source]
Return type:

KeysView[str]

register_events(dispatcher)[source]
Parameters:

dispatcher (IAsyncEventDispatcher)

register_services(container, config)[source]
Parameters:
remove(*names)[source]
resolve_name(spec)[source]
resolve_short_name(full_name)[source]
values()[source]
Return type:

ValuesView[Application]

namespaces = ['harp_apps']
applications = {}

Cache for applications