How to use the txzmq.ZmqPullConnection function in txZMQ

To help you get started, we’ve selected a few txZMQ examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github leapcode / leap_pycommon / src / leap / common / events / server.py View on Github external
def __init__(self, emit_addr, reg_addr):
        """
        Initialize the events server.

        :param emit_addr: The address in which to receive events from clients.
        :type emit_addr: str
        :param reg_addr: The address to which publish events to clients.
        :type reg_addr: str
        """
        TxZmqServerComponent.__init__(self)
        # bind PULL and PUB sockets
        self._pull, self.pull_port = self._zmq_bind(
            txzmq.ZmqPullConnection, emit_addr)
        self._pub, self.pub_port = self._zmq_bind(
            txzmq.ZmqPubConnection, reg_addr)
        # set a handler for arriving messages
        self._pull.onPull = self._onPull
github gtaylor / dockerized-image-crawler / crawler / crawler_worker / services / zeromq.py View on Github external
def startService(self):
        factory = ZmqFactory()
        log.msg("Listener connecting to broadcaster: %s" % ZMQ_PUSHER)
        endpoint = ZmqEndpoint('connect', ZMQ_PUSHER)
        self.conn = ZmqPullConnection(factory, endpoint)
        self.conn.onPull = self._message_received
github gtaylor / dockerized-image-crawler / crawler / webapi_service / services / zeromq.py View on Github external
def startService(self):
        factory = ZmqFactory()
        bind_point = 'tcp://0.0.0.0:8051'
        log.msg("Repeater binding on: %s" % bind_point)
        endpoint = ZmqEndpoint('bind', bind_point)
        self.conn = ZmqPullConnection(factory, endpoint)
        self.conn.onPull = self._message_received