init new structure

This commit is contained in:
2025-12-05 17:43:13 +08:00
parent 6b3b1a1f76
commit c59d29d52e
12 changed files with 264 additions and 156 deletions
+4 -7
View File
@@ -7,6 +7,10 @@ MarketOrderTraded = "market_order_traded" # 市价单成交
# Pring Log
EventPrintLog = "print_log" # 打印日志
# 订阅与发布事件示例
# event_bus.subscribe('my_event', handle_event)
# event_bus.publish('my_event', {'key': 'value'})
class EventBus:
def __init__(self):
self.listeners = {} # 管理各种event的订阅情况
@@ -21,12 +25,5 @@ class EventBus:
for listener in self.listeners[event_type]:
listener(data)
# # 订阅事件
# event_bus.subscribe('my_event', handle_event)
# # 发布事件
# event_bus.publish('my_event', {'key': 'value'})
# 创建事件总线实例
event_bus = EventBus()