aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/hrc/core.py
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2024-07-06 09:34:39 +0800
committer简律纯 <i@jyunko.cn>2024-07-06 09:34:39 +0800
commite44fe8dfba3a56da39f444cfeb62acd0945a9462 (patch)
treea6d4cc737ce7fb8a0ee7192c70ffdf4b998bbf3e /hrc/core.py
parent71880e56e2ad2cf376e584efe91a2bfb73084264 (diff)
downloadHydroRollCore-e44fe8dfba3a56da39f444cfeb62acd0945a9462.tar.gz
HydroRollCore-e44fe8dfba3a56da39f444cfeb62acd0945a9462.zip
feat(core): impl hot reload
Diffstat (limited to 'hrc/core.py')
-rw-r--r--hrc/core.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/hrc/core.py b/hrc/core.py
index 3625379..cb8da6e 100644
--- a/hrc/core.py
+++ b/hrc/core.py
@@ -69,6 +69,12 @@ class Core:
_condition: (
asyncio.Condition
) # Condition used to handle get # pyright: ignore[reportUninitializedInstanceVariable]
+ _rule_tasks: Set[
+ "asyncio.Task[None]"
+ ] # Adapter task collection, used to hold references to adapter tasks
+ _handle_event_tasks: Set[
+ "asyncio.Task[None]"
+ ] # Event handling task, used to keep a reference to the adapter task
def __init__(
self,
@@ -85,7 +91,12 @@ class Core:
self._restart_flag = False
self._module_path_finder = ModulePathFinder()
self.rules_priority_dict = defaultdict(list)
+ self._raw_config_dict = {}
+ self._rule_tasks = set()
+ self._handle_event_tasks = set()
+ self._extend_rules = []
+ self._extend_rule_dirs = []
self._core_run_hooks = []
self._core_exit_hooks = []
self._rule_enable_hooks = []