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
6
votes
2 answers

ZeroMQ, how to connect to external tcp socket?

Can you please tell me how you can use to send messages ZeroMQ between two programs located on different servers using some common socket? With all local sockets program works, but I do not understand how they spread to different places. Because…
Ellochka Cannibal
  • 1,750
  • 2
  • 19
  • 31
6
votes
1 answer

Why is gevent.sleep(0.1) necessary in this example to prevent the app from blocking?

I'm pulling my hair out over this one. I'm trying to get the simplest of examples working with zeromq and gevent. I changed this script to use PUB/SUB sockets and when I run it the 'server' socket loops forever. If I uncomment the…
Ralph Caraveo
  • 10,025
  • 7
  • 40
  • 52
6
votes
2 answers

pyzmq non-blocking socket

Can someone point me to an example of a REQ/REP non-blocking ZeroMQ (0MQ) with Python bindings? Perhaps my understanding of ZMQ is faulty but I couldn't find an example online. I have a server in Node.JS that sends work from multiple clients to the…
ejang
  • 3,982
  • 8
  • 44
  • 70
6
votes
1 answer

Pyzmq Error in IPython Notebook

I'm trying to run IPython notebook in Vista. I believe I installed all the necessary dependencies (listed here) with easy_install. IPython runs fine. But when I try and run the IPython notebook everything starts up fine but then the kernel dies…
ACV
  • 1,895
  • 1
  • 19
  • 28
5
votes
3 answers

Limiting queue length with PyZMQ

I want to limit the amount of memory consumed by my ZeroMQ message queues in a Python application. I know that setting the high-water mark will limit the amount that will be queued on the sender side, but is there a way to control how much will be…
5
votes
2 answers

Why ZeroMQ fails to communicate when I use multiprocessing.Process to run?

please see the code below : server.py import zmq import time from multiprocessing import Process class A: def __init__(self): ctx = zmq.Context(1) sock = zmq.Socket(ctx, zmq.PUB) sock.bind('ipc://test') p = Process(target=A.run,…
nick huang
  • 443
  • 4
  • 12
5
votes
0 answers

json.loads and pickle.loads not usable with async keyword?

I have a zmq server that subscribes to several publisher (but in this example only to one) After making the server async by creating a coroutine and receiving a serialized multipart message deserialization with pickle.loads and json.loads both seem…
Rene Pickhardt
  • 692
  • 5
  • 17
5
votes
1 answer

How to send byte message with ZeroMQ PUB / SUB setting?

So I'm new to ZeroMQ and I am trying to send byte message with ZeroMQ, using a PUB / SUB setting. Choice of programming language is not important for this question since I am using ZeroMQ for communication between multiple languages. Here is my…
Louis Ng
  • 533
  • 1
  • 7
  • 16
5
votes
1 answer

Using ZeroMQ to send replies to specific clients and queue if client disconnects

I'm new to ZeroMQ and trying to figure out a design issue. My scenario is that I have one or more clients sending requests to a single server. The server will process the requests, do some stuff, and send a reply to the client. There are two…
JoshG
  • 6,472
  • 2
  • 38
  • 61
5
votes
1 answer

HTTP server in ZMQ or How to handle a POST request with pyzmq?

I'm trying to create an HTTP server with ZMQ_STREAM socket. When I do a simple POST request: POST HTTP/1.1 Host: localhost:5555 Cache-Control: no-cache Postman-Token: 67004be5-56bc-c1a9-847a-7db3195c301d Apples to Oranges! Here is how I handle…
Andriy Drozdyuk
  • 58,435
  • 50
  • 171
  • 272
5
votes
1 answer

ZeroMQ/Python - CPU affinity hickup?

I have the following strange situation. We have a process, call it Distributor, that receives tasks over ZeroMQ/TCP from Client, and accumulates them in a queue. There is a Worker process, which talks with the Distributor over ZeroMQ/IPC. The…
SashaM
  • 311
  • 1
  • 7
5
votes
2 answers

How to setup a ZMQ PUB/SUB pattern to serve only for pre-authorized subscriber(s)

How can I implement or do kind of "hack" in PUB-SUB pattern to get an ability to publish only to authorized subscribers, disconnect unauthorized subscribers etc? I googled for this problem, but all the answers very similar to set subscribe filter in…
user2123079
  • 656
  • 8
  • 29
5
votes
1 answer

How to handle multiple publishers on same port in zmq?

This question has been asked before, here. I have the exact same problem. I want to publish from a bunch of different processes, and use the same port every time. I tried the solution presented in the answer, but this did not work for me. I get the…
Wapiti
  • 1,851
  • 2
  • 20
  • 40
5
votes
1 answer

how to check send data in zeromq is successful or not

I am new to zmq and network programming. I want to use pyzmq library to write a simple function to send/receive data between client and server (using REQ/REP pattern). What I did for sending the data was the following: def send_data(socket, data): …
ohmygoddess
  • 619
  • 1
  • 7
  • 23
5
votes
2 answers

Why does zmq.setsockopt_string complain about default 'ascii' code?

I'm trying to figure out if my dev environment is somehow screwed up, since "it works on [my colleagues] computer" but not mine. Instead of tackling the 'meat' of the problem, I'm working on the first funny thing I've spotted. I have a bit of code…
Bitdiot
  • 1,506
  • 2
  • 16
  • 30