From e9a780496f7ce067e0d8d51ce1d62e48c9f2a8d9 Mon Sep 17 00:00:00 2001 From: HsiangNianian Date: Thu, 19 Sep 2024 14:44:33 +0800 Subject: feat(core): Implement Service class and related functionalities Co-authored-by: yuzhe --- hrc/typing.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'hrc/typing.py') diff --git a/hrc/typing.py b/hrc/typing.py index d74fd26..a207c80 100644 --- a/hrc/typing.py +++ b/hrc/typing.py @@ -4,17 +4,20 @@ from typing import TYPE_CHECKING, Awaitable, Callable, Optional, TypeVar if TYPE_CHECKING: from typing import Any - from .core import Core - from .config import ConfigModel - from .event import Event - from .rule import Rule + from hrc.service import Service + from hrc.core import Core + from hrc.config import ConfigModel + from hrc.event import Event + from hrc.rule import Rule StateT = TypeVar("StateT") EventT = TypeVar("EventT", bound="Event[Any]") RuleT = TypeVar("RuleT", bound="Rule[Any, Any, Any]") ConfigT = TypeVar("ConfigT", bound=Optional["ConfigModel"]) +ServiceT = TypeVar("ServiceT", bound="Service[Any, Any]") CoreHook = Callable[["Core"], Awaitable[None]] RuleHook = Callable[["Rule"], Awaitable[None]] +ServiceHook = Callable[["Service[Any, Any]"], Awaitable[None]] EventHook = Callable[["Event[Any]"], Awaitable[None]] -- cgit v1.2.3-70-g09d2