本文整理汇总了Python中core.event_bus.EventBus.register_simple_handler方法的典型用法代码示例。如果您正苦于以下问题:Python EventBus.register_simple_handler方法的具体用法?Python EventBus.register_simple_handler怎么用?Python EventBus.register_simple_handler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core.event_bus.EventBus
的用法示例。
在下文中一共展示了EventBus.register_simple_handler方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from core.event_bus import EventBus [as 别名]
# 或者: from core.event_bus.EventBus import register_simple_handler [as 别名]
def __init__(self, java_sock):
self.java_obj = java_sock
def simple_handler(msg):
self.write(msg.body)
self.handler_id = EventBus.register_simple_handler(True, simple_handler)
示例2: __init__
# 需要导入模块: from core.event_bus import EventBus [as 别名]
# 或者: from core.event_bus.EventBus import register_simple_handler [as 别名]
def __init__(self, java_sock):
self.java_obj = java_sock
self.remote_addr = None
self.local_addr = None
def simple_handler(msg):
self.write(msg.body)
self.handler_id = EventBus.register_simple_handler(True, simple_handler)
示例3: __init__
# 需要导入模块: from core.event_bus import EventBus [as 别名]
# 或者: from core.event_bus.EventBus import register_simple_handler [as 别名]
def __init__(self, j_socket):
self.java_obj = j_socket
def simple_handler(msg):
self.write_buffer(msg.body)
self.write_handler_id = EventBus.register_simple_handler(False, simple_handler)
def wrapped_closed_handler():
EventBus.unregister_handler(self.write_handler_id)
if hasattr(self, "_closed_handler"):
self._closed_handler()
self.java_obj.closedHandler(ClosedHandler(wrapped_closed_handler))
示例4: __init__
# 需要导入模块: from core.event_bus import EventBus [as 别名]
# 或者: from core.event_bus.EventBus import register_simple_handler [as 别名]
def __init__(self, j_socket):
self.java_obj = j_socket
self.remote_addr = None
self.local_addr = None
def simple_handler(msg):
self.write(msg.body)
self.write_handler_id = EventBus.register_simple_handler(False, simple_handler)
def wrapped_close_handler():
EventBus.unregister_handler(self.write_handler_id)
if hasattr(self, "_close_handler"):
self._close_handler()
self.java_obj.closeHandler(CloseHandler(wrapped_close_handler))