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


Python green.PUB属性代码示例

本文整理汇总了Python中zmq.green.PUB属性的典型用法代码示例。如果您正苦于以下问题:Python green.PUB属性的具体用法?Python green.PUB怎么用?Python green.PUB使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在zmq.green的用法示例。


在下文中一共展示了green.PUB属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: connect

# 需要导入模块: from zmq import green [as 别名]
# 或者: from zmq.green import PUB [as 别名]
def connect(self, context):
        if self.socket is not None:
            return

        self.context = context

        self.socket = context.socket(zmq.PUB)
        self.socket.bind('ipc:///var/run/minemeld/{}'.format(self.fanout))

        self.reply_socket = context.socket(zmq.REP)
        self.reply_socket.bind('ipc:///var/run/minemeld/{}:reply'.format(self.fanout)) 
开发者ID:PaloAltoNetworks,项目名称:minemeld-core,代码行数:13,代码来源:zmqredis.py

示例2: on_start

# 需要导入模块: from zmq import green [as 别名]
# 或者: from zmq.green import PUB [as 别名]
def on_start(self):
        self.sock = self.ctx.socket(zmq.PUB)
        if 'bind' in self.config:
            self.sock.bind(self.config['bind'])
        elif 'connect' in self.config:
            self.sock.connect(self.config['connect']) 
开发者ID:20c,项目名称:vaping,代码行数:8,代码来源:zeromq.py

示例3: __init__

# 需要导入模块: from zmq import green [as 别名]
# 或者: from zmq.green import PUB [as 别名]
def __init__(self,
                 zmq_context,
                 zmq_proxy_xsub_url=ait.SERVER_DEFAULT_XSUB_URL,
                 zmq_proxy_xpub_url=ait.SERVER_DEFAULT_XPUB_URL,
                 **kwargs):

        self.context = zmq_context
        # open PUB socket & connect to broker
        self.pub = self.context.socket(zmq.PUB)
        self.pub.connect(zmq_proxy_xsub_url.replace('*', 'localhost'))

        # calls gevent.Greenlet or gs.DatagramServer __init__
        super(ZMQClient, self).__init__(**kwargs) 
开发者ID:NASA-AMMOS,项目名称:AIT-Core,代码行数:15,代码来源:client.py

示例4: configure

# 需要导入模块: from zmq import green [as 别名]
# 或者: from zmq.green import PUB [as 别名]
def configure():
    # Get the list of transports to bind from settings. This allows us to PUB
    # messages to multiple announcers over a variety of socket types
    # (UNIX sockets and/or TCP sockets).
    for binding in Settings.GATEWAY_SENDER_BINDINGS:
        sender.bind(binding)

    for schemaRef, schemaFile in Settings.GATEWAY_JSON_SCHEMAS.iteritems():
        validator.addSchemaResource(schemaRef, resource_string('eddn.Gateway', schemaFile)) 
开发者ID:EDSM-NET,项目名称:EDDN,代码行数:11,代码来源:Gateway.py

示例5: passthrough

# 需要导入模块: from zmq import green [as 别名]
# 或者: from zmq.green import PUB [as 别名]
def passthrough(zmq_context=None):
    if zmq_context is None:
        zmq_context = zmq_ctx
    zmq_sock_pull = zmq_context.socket(zmq.PULL)
    zmq_sock_pull.bind(ZMQ_PASSTHROUGH_URL_PULL)

    zmq_sock_pub = zmq_context.socket(zmq.PUB)
    zmq_sock_pub.bind(ZMQ_PASSTHROUGH_URL_PUB)
    while True:
        zmq_sock_pub.send_string(zmq_sock_pull.recv())

# If being run as a seperate process: 
开发者ID:ResEnv,项目名称:chain-api,代码行数:14,代码来源:zmq_passthrough.py


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