初始化事件引擎
(self)
| 15 | """事件驱动引擎""" |
| 16 | |
| 17 | def __init__(self): |
| 18 | """初始化事件引擎""" |
| 19 | # 事件队列 |
| 20 | self.__queue = Queue() |
| 21 | |
| 22 | # 事件引擎开关 |
| 23 | self.__active = False |
| 24 | |
| 25 | # 事件引擎处理线程 |
| 26 | self.__thread = Thread(target=self.__run, name="EventEngine.__thread") |
| 27 | |
| 28 | # 事件字典,key 为时间, value 为对应监听事件函数的列表 |
| 29 | self.__handlers = defaultdict(list) |
| 30 | |
| 31 | def __run(self): |
| 32 | """启动引擎""" |
nothing calls this directly
no outgoing calls
no test coverage detected