Added support for dynamic loaded modules

This commit is contained in:
2021-11-15 21:23:06 +01:00
parent a3bf5535f6
commit 562caeb10b
12 changed files with 110 additions and 34 deletions

View File

@@ -0,0 +1 @@
# imports

View File

@@ -0,0 +1,21 @@
from cpl_core.environment.application_environment_abc import \
ApplicationEnvironmentABC
from cpl_core.logging import LoggerABC
from cpl_query.extension import List
from modules_core.abc.module_abc import ModuleABC
from modules_core.abc.module_service_abc import ModuleServiceABC
class ModuleService(ModuleServiceABC):
def __init__(self, logger: LoggerABC, env: ApplicationEnvironmentABC):
self._logger = logger
self._env = env
self._modules: List[ModuleABC] = List()
def register(self, module: ModuleABC):
self._modules.append(module)
def start_modules(self):
self._modules.for_each(lambda m: m.echo())