minos.common.launchers

Classes

EntrypointLauncher

EntryPoint Launcher class.

class EntrypointLauncher[source]

Bases: SetupMixin

EntryPoint Launcher class.

__init__(config, injections, ports, log_level=logging.INFO, log_format='color', log_date_format=DateFormat['color'], external_modules=None, external_packages=None, *args, **kwargs)[source]
Parameters
launch()[source]

Launch a new execution and keeps running forever..

Returns

This method does not return anything.

Return type

NoReturn

graceful_launch()[source]

Launch the execution gracefully.

Returns

This method does not return anything.

Return type

None

graceful_shutdown(err=None)[source]

Shutdown the execution gracefully.

Returns

This method does not return anything.

Parameters

err (Optional[Exception]) –

Return type

None

entrypoint

Entrypoint instance.

Returns

An Entrypoint instance.

loop

Create the loop.

Returns

An AbstractEventLoop instance.

ports

List of ports to be launched.

Returns

A list of Port instances.

property services: list[minos.common.ports.Port]

List of ports to be launched.

Returns

A list of Port instances.

property injections: dict[str, minos.common.injections.mixins.InjectableMixin]

Get the injections mapping.

Returns

A dict with injection names as keys and injection instances as values.

injector

Dependency injector instance.

Returns

A DependencyInjector instance.

property already_destroyed: bool

Already Destroy getter.

Returns

A boolean value.

property already_setup: bool

Already Setup getter.

Returns

A boolean value.

async destroy()

Destroy miscellaneous repository things.

Returns

This method does not return anything.

Return type

None

classmethod from_config(config=None, **kwargs)

Build a new instance from config.

Parameters
  • config (Optional[Union[Config, Path]]) – Config instance. If None is provided, default config is chosen.

  • kwargs – Additional named arguments.

Returns

A instance of the called class.

Return type

S

async setup()

Setup miscellaneous repository things.

Returns

This method does not return anything.

Return type

None