當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。