dev
This commit is contained in:
23
neko_run_controller_asyncio/neko/interfaces.py
Normal file
23
neko_run_controller_asyncio/neko/interfaces.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from neko_run_controller_std.neko.types import LogsHandler
|
||||
from typing import Type
|
||||
import dataclasses
|
||||
|
||||
from neko_run_controller_std.neko.interfaces import RunControllerHandlersInterface
|
||||
|
||||
|
||||
@dataclasses.dataclass
|
||||
class __HiddenStorage:
|
||||
logs_handlers: list[Type[LogsHandler]] = dataclasses.field(default_factory=list)
|
||||
|
||||
|
||||
_storage = __HiddenStorage()
|
||||
|
||||
|
||||
class RRunControllerHandlersInterface(RunControllerHandlersInterface):
|
||||
@staticmethod
|
||||
def add_logs_handler(handler: Type[LogsHandler]):
|
||||
_storage.logs_handlers.append(handler)
|
||||
|
||||
|
||||
RunControllerHandlersInterface = RRunControllerHandlersInterface
|
||||
__all__ = [RunControllerHandlersInterface]
|
||||
Reference in New Issue
Block a user