MCPcopy
hub / github.com/AstrBotDevs/AstrBot / __init__

Method __init__

astrbot/core/event_bus.py:26–37  ·  view source on GitHub ↗
(
        self,
        event_queue: Queue,
        pipeline_scheduler_mapping: dict[str, PipelineScheduler],
        astrbot_config_mgr: AstrBotConfigManager,
    )

Source from the content-addressed store, hash-verified

24 """用于处理事件的分发和处理"""
25
26 def __init__(
27 self,
28 event_queue: Queue,
29 pipeline_scheduler_mapping: dict[str, PipelineScheduler],
30 astrbot_config_mgr: AstrBotConfigManager,
31 ) -> None:
32 self.event_queue = event_queue # 事件队列
33 # abconf uuid -> scheduler
34 self.pipeline_scheduler_mapping = pipeline_scheduler_mapping
35 self.astrbot_config_mgr = astrbot_config_mgr
36 # 持有正在执行的 pipeline 任务的强引用, 防止 task 在 pending 状态被 GC 回收
37 self._pending_tasks: set[asyncio.Task] = set()
38
39 async def dispatch(self) -> None:
40 while True:

Callers

nothing calls this directly

Calls 1

setFunction · 0.85

Tested by

no test coverage detected