Refactor the tunnel-related code to make the logic of the Agent sending messages to the Human more reasonable.

This commit is contained in:
Liu Zhicong
2023-11-08 22:13:18 -08:00
parent 7fd3749a40
commit de685da38b
15 changed files with 652 additions and 232 deletions
+3
View File
@@ -109,6 +109,9 @@ class AIBus:
# means sub
def register_message_handler(self,handler_name:str,handler:Any) -> Queue:
handler_node = AIBusHandler(handler,self)
if self.handlers.get(handler_name) is not None:
logger.warn(f"handler {handler_name} already register on AI_BUS!")
self.handlers[handler_name] = handler_node
return handler_node.queue