本文整理汇总了Python中autobahn.wamp.WampServerFactory.dispatch方法的典型用法代码示例。如果您正苦于以下问题:Python WampServerFactory.dispatch方法的具体用法?Python WampServerFactory.dispatch怎么用?Python WampServerFactory.dispatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类autobahn.wamp.WampServerFactory
的用法示例。
在下文中一共展示了WampServerFactory.dispatch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: WebSocketServer
# 需要导入模块: from autobahn.wamp import WampServerFactory [as 别名]
# 或者: from autobahn.wamp.WampServerFactory import dispatch [as 别名]
class WebSocketServer():
server = None
def __init__(self, port, debug):
if debug:
log.startLogging(sys.stdout)
self.server = WampServerFactory("ws://localhost:"+ str(port), debug)
self.server.protocol = LogeeProtocol
listenWS(self.server)
def broadcast(self, topic, message):
self.server.dispatch(topic, message)
示例2: dispatch
# 需要导入模块: from autobahn.wamp import WampServerFactory [as 别名]
# 或者: from autobahn.wamp.WampServerFactory import dispatch [as 别名]
def dispatch(self, topicUri, event, exclude = [], eligible = None):
"""
Normal dispatch from a WAMP client publish.
"""
d = WampServerFactory.dispatch(self, topicUri, event, exclude, eligible)
d.addCallback(self.logNormalDispatch)
return d
示例3: dispatchHubEvent
# 需要导入模块: from autobahn.wamp import WampServerFactory [as 别名]
# 或者: from autobahn.wamp.WampServerFactory import dispatch [as 别名]
def dispatchHubEvent(self, topicuri, event, exclude = [], eligible = None):
"""
Dispatch from a REST API Push.
"""
if exclude:
exclude = self.sessionIdsToProtos(exclude)
if eligible:
eligible = self.sessionIdsToProtos(eligible)
return WampServerFactory.dispatch(self, topicuri, event, exclude, eligible)