minos.common.launchers
Classes
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
config (Config) –
injections (list[Union[minos.common.setup.SetupMixin, type[minos.common.setup.SetupMixin], str]]) –
ports (list[Union[minos.common.ports.Port, type[minos.common.ports.Port], str]]) –
- launch()[source]
Launch a new execution and keeps running forever..
- Returns
This method does not return anything.
- Return type
- graceful_launch()[source]
Launch the execution gracefully.
- Returns
This method does not return anything.
- 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.
- 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