add 事件广播

This commit is contained in:
jxxghp
2023-06-16 07:11:14 +08:00
parent ed14485092
commit 6a5e117f0b
49 changed files with 70 additions and 49 deletions

View File

@ -6,13 +6,14 @@ from typing import Optional, Any, Tuple, List, Set, Union, Dict
from ruamel.yaml import CommentedMap
from app.core.context import Context
from app.core.event import EventManager
from app.core.module import ModuleManager
from app.core.context import MediaInfo, TorrentInfo
from app.core.meta import MetaBase
from app.log import logger
from app.schemas.context import TransferInfo, TransferTorrent, ExistMediaInfo, DownloadingTorrent
from app.utils.singleton import AbstractSingleton, Singleton
from app.utils.types import TorrentStatus, MediaType
from app.schemas.types import TorrentStatus, MediaType
class ChainBase(AbstractSingleton, metaclass=Singleton):
@ -25,6 +26,7 @@ class ChainBase(AbstractSingleton, metaclass=Singleton):
公共初始化
"""
self.modulemanager = ModuleManager()
self.eventmanager = EventManager()
@abstractmethod
def process(self, *args, **kwargs) -> Optional[Context]: