From e44fe8dfba3a56da39f444cfeb62acd0945a9462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AE=80=E5=BE=8B=E7=BA=AF?= Date: Sat, 6 Jul 2024 09:34:39 +0800 Subject: [PATCH] feat(core): impl hot reload --- hrc/core.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 @@ def __init__( 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 = []