Questions tagged [pyzmq]

PyZMQ is the Python bindings for 0MQ (also spelled ZeroMQ, ØMQ or ZMQ), written almost entirely in Cython

Python bindings for 0MQ, a high-performance asynchronous messaging library aimed at use in scalable distributed or concurrent applications. It provides a message queue, but unlike message-oriented middleware, a 0MQ system runs without a dedicated message broker.

For a brief introduction read the ZeroMQ concept & properties from

PyZMQ works with Python 3 (≥ 3.3), and Python 2.7, with no transformations or 2to3, as well as PyPy (at least 2.0 beta), via CFFI.

PyZMQ started it python journey since the ZeroMQ API v2.1.1, those days in Python 2.6

Useful links:

627 questions
5
votes
1 answer

Python ZMQ and multiprocessing causes zmq.error.ZMQError: Interrupted system call

I have a Python script where I'm binding several (e.g., 5) ZMQ receiver sockets like so: receiver_1 = context.socket(zmq.PULL) receiver_1.bind("tcp://*:5555") ... receiver_5 = context.socket(zmq.PULL) receiver_5.bind("tcp://*:5559") receivers =…
Marvin
  • 51
  • 4
5
votes
2 answers

Simple client/server ZMQ in Python to send multiple lines per request

This is my first exposure to ZMQ under Python and I want the server to sent multiple lines when it receives a request from the client. The code that I added to the example offered by ZMQ on the server side is: with open("test.txt", 'r') as f: …
flamenco
  • 2,702
  • 5
  • 30
  • 46
5
votes
2 answers

Why won't ZMQ drop messages?

I have an application which fetches messages from a ZeroMQ publisher, using a PUB/SUB setup. The reader is slow sometimes so I set a HWM on both the sender and receiver. I expect that the receiver will fill the buffer and jump to catch up when it…
Brendan Howell
  • 319
  • 2
  • 11
5
votes
4 answers

Cannot import zmq in python (install issue)

I can't seem to install pyzmq on my macbook (OSX 10.9.1) First call was to run: sudo pip install pyzmq There was an error that libzmq couldn't be found, and it appeared to try and compile the bundled version: jono@air:~ $ sudo pip install…
Jono
  • 707
  • 2
  • 8
  • 17
5
votes
2 answers

trying to understand zeromq high water mark behaviour

I have been playing around with pyzmq and simple load balancing using HWM, and I don't quite understand the behaviour I am seeing. I have set up a simple multithreading test, with a DEALER client connected to two workers via a ROUTER to DEALER…
TheTaintedOne
  • 335
  • 3
  • 12
5
votes
2 answers

ZeroMQ: HWM on PUSH does not work

I am trying to write a server/client script with a server that vents the tasks, and multiple workers that execute it. The problem is that my ventilator has so many tasks that it would fill up the memory in a heartbeat. I tried to set the HWM before…
Elvin
  • 843
  • 8
  • 14
5
votes
2 answers

ZeroMQ ROUTER socket can not send message to REP socket

I was implemented a simple request-reply architecture with a router using ZeroMQ. This works correctly for PyZMQ version 2.1.11. Unfortunately, when I test it on PyZMQ version 14.0.0, sender (REQ) can send to the router then router received its…
GTavasoli
  • 448
  • 4
  • 11
5
votes
4 answers

py2exe: error: libzmq.pyd: No such file or directory

During py2exe build I get the following error: creating python loader for extension 'win32clipboard' (C:\Python27\lib\site-packages\win32\win32clipboard.pyd -> win32clipboard.pyd) creating python loader for extension '_rl_accel'…
Mads M Pedersen
  • 579
  • 6
  • 16
4
votes
2 answers

Multiprocessing vs gevent

Currently I am using zeromq with pub-sub pattern, I have single worker to publish and many(8) subscriber (all will subscribe) to same pattern. Now I tried multiprocessing to spawn subscribers it works. I am missing few messages. Why I am using…
Kracekumar
  • 19,457
  • 10
  • 47
  • 56
4
votes
1 answer

Reading the stdout from slave nodes with ipcluster

I've set up a cluster using ipcluster start --n=8 then accessed it using from IPython.parallel import Client c=Client() dview=c[:] e=[i for i in c] I'm running processes on the slave nodes (e[0]-e[7]) which take a lot of time and I'd like them to…
4
votes
2 answers

ZeroMQ how to get binded address in pyzmq

I'm using ZMQ bindings in Python, and I want to bind clients to some port, and then send that location to other clients to connect. Now this is basic binding code: subscriber = context.socket(zmq.SUB) ... subscriber.bind("tcp://0.0.0.0:12345") What…
Bojan Radojevic
  • 1,015
  • 3
  • 16
  • 26
4
votes
2 answers

Identifying the origin of ZMQ messages?

If I receive a message via the recv() method on a ZeroMQ (0MQ) socket... data = s.recv() ...is there any way for me to get at the value of getpeername() for the underlying socket? My goal is to identify the origin of the message in a way that does…
larsks
  • 277,717
  • 41
  • 399
  • 399
4
votes
1 answer

Why is it faster sending data as encoded string than sending it as bytes?

I'm playing with pyzmq for inter-process transfer of 4k HDR image data and noticed that this: byt = np.array2string(np.random.randn(3840,2160,3)).encode() while True: socket.send(byt) is much much faster than: byt =…
roque2205
  • 49
  • 2
4
votes
1 answer

zmq.error.ZMQError: Address already in use, when running multiprocessing with multiple notebooks using papermill

I am using the papermill library to run multiple notebooks using multiprocessing simultaneously. This is occurring on Python 3.6.6, Red Hat 4.8.2-15 within a Docker container. However when I run the python script, about 5% of my notebooks do not…
Dan
  • 63
  • 1
  • 6
4
votes
1 answer

ZeroMQ: very high latency with PUSH/PULL

Summary I see very high latency at the receiver using zmq.PUSH/PULL sockets. Details I'm new to ZeroMQ, and am trying to send a few MBytes from the sender to the receiver (my final aim is to send a camera stream from the sender to the receiver). The…
Mayank
  • 1,236
  • 1
  • 12
  • 22