当前位置: 首页>>代码示例>>Python>>正文


Python WampServerFactory.dispatch方法代码示例

本文整理汇总了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)
开发者ID:codename-heroes,项目名称:pervastered-interface,代码行数:15,代码来源:websocket_server.py

示例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
开发者ID:jamjr,项目名称:crossbar,代码行数:9,代码来源:hubwebsocket.py

示例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)
开发者ID:jamjr,项目名称:crossbar,代码行数:11,代码来源:hubwebsocket.py


注:本文中的autobahn.wamp.WampServerFactory.dispatch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。