/usr/lib/python3/dist-packages/txzmq/pushpull.py is in python3-txzmq 0.8.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | """
ZeroMQ PUSH-PULL wrappers.
"""
from zmq import constants
from txzmq.connection import ZmqConnection
class ZmqPushConnection(ZmqConnection):
"""
Pushing messages to the socket.
Wrapper around ZeroMQ PUSH socket.
"""
socketType = constants.PUSH
def push(self, message):
"""
Push a message L{message}.
:param message: message data
:type message: str
"""
self.send(message)
class ZmqPullConnection(ZmqConnection):
"""
Pull messages from a socket.
Wrapper around ZeroMQ PULL socket.
Subclass and override :meth:`onPull`.
"""
socketType = constants.PULL
def messageReceived(self, message):
"""
Called on incoming message from ZeroMQ.
:param message: message data
"""
self.onPull(message)
def onPull(self, message):
"""
Called on incoming message received by puller.
:param message: message data
"""
raise NotImplementedError(self)
|