setup for rework of monitor/handler/conductor interactions

This commit is contained in:
PatchOfScotland
2023-04-18 16:24:08 +02:00
parent ddca1f6aa4
commit b87fd43cfd
9 changed files with 80 additions and 20 deletions

View File

@ -54,6 +54,7 @@ class BaseMonitor:
check_implementation(type(self).remove_recipe, BaseMonitor)
check_implementation(type(self).get_recipes, BaseMonitor)
check_implementation(type(self).get_rules, BaseMonitor)
check_implementation(type(self).send_event_to_runner, BaseMonitor)
# Ensure that patterns and recipes cannot be trivially modified from
# outside the monitor, as this will cause internal consistency issues
self._patterns = deepcopy(patterns)
@ -88,6 +89,9 @@ class BaseMonitor:
be implemented by any child class."""
pass
def send_event_to_runner(self, msg):
self.to_runner.send(msg)
def start(self)->None:
"""Function to start the monitor as an ongoing process/thread. Must be
implemented by any child process"""