zeromq

ZeroMQ N to N async pattern in Python

十年热恋 提交于 2019-12-06 15:37:02
N-proxy-N Pub-Sub Similar to the question N to N async pattern in ZeroMQ? , but which unfortunately never received an answer with working code. I'm trying to implement Pub-Sub network as described in the guide: http://zguide.zeromq.org/py:all#The-Dynamic-Discovery-Problem (a small message broker in the style of N-proxy-N). Unfortunately, the guide doesn't provide any code examples. I've tried to implement an Hello World example using PyZMQ, I think I'm close, but I'm facing some errors I don't know how to handle. Sorry for the use of asyncio (I'm more comfortable with this then threads). Code

ZeroMQ (clrzmq4) polling issue

[亡魂溺海] 提交于 2019-12-06 10:49:46
What I'm trying to accomplish is to implement reading a message from one of two sockets, wherever it arrives first. As far as I understand polling ( zmq_poll ) is the right thing to do (as demonstrated in mspoller in guide ). Here I'll provide small pseudo-code snippet: TimeSpan timeout = TimeSpan.FromMilliseconds(50); using (var receiver1 = new ZSocket(ZContext.Current, ZSocketType.DEALER)) using (var receiver2 = new ZSocket(ZContext.Current, ZSocketType.PAIR)) { receiver1.Bind("tcp://someaddress"); // Note that PAIR socket is inproc: receiver2.Connect("inproc://otheraddress"); var poll =

zeromq pattern: pub/sub with guaranteed delivery

自闭症网瘾萝莉.ら 提交于 2019-12-06 10:16:56
问题 I'd like to fan out messages and be sure that any connected socket has received them, if present. So is there a pattern to achieve the following: PUB socket shall block on watermark if there is one or more SUB connected, i.e. all of the SUB sockets have received the message. PUB socket shall drop on watermark if there is no SUB connected. I use nzmqt within Qt5 on OSX/Linux, if this is helpful or the mentioned problem could be solved in this special case. 来源: https://stackoverflow.com

ImportError: cannot import name constants

夙愿已清 提交于 2019-12-06 09:53:38
问题 I'm trying to run a simple piece of code using pyzmq. I am using Python 2.7 and pyzmq 14.5 $ python --version Python 2.7.6 $ sudo find /usr -name "*pyzmq*" /usr/local/lib/python2.7/dist-packages/pyzmq-14.5.0.egg-info /usr/lib/python2.7/dist-packages/pyzmq-14.0.1.egg-info Following is the code i'm trying to run: import zhelpers context = zmq.Context.instance() server = context.socket(zmq.ROUTER) server.bind("tcp://*:5678") while (1): address, empty, data = server.recv_multipart() print(

Is There any way to achieve a ZeroMQ fullduplex channel?

烈酒焚心 提交于 2019-12-06 09:36:29
The project is to build a messaging mechanism between a Python and C# program via ZeroMQ . I want messages to be able to travel in/out from both ends at any time, which is NOT a basic request-reply model a.k.a. REQ/REP . One way I can think of is to build a PUB/SUB model on two ports, i.e. two one way channels. Is there any method to get a real duplex channel? There are several ways to do this with ZeroMQ. I suggest using a DEALER/ROUTER socket pair: Choose one program to be the "server", the other the "client". The server will bind a ROUTER socket on a port. The client will connect a DEALER

Is it possible to add an event handling to ZeroMQ to act when data is received/sent?

不问归期 提交于 2019-12-06 08:12:56
I have created two unrelated daemon processes in C in Linux Ubuntu. These processes are in the sleeping mode, they only wake up when the data is received, and perform the action implemented in the signal handler and again sleep. I have implemented this communication using SIGNAL IPC and message queue. Before sending the message, I send the signal SIGUSR1 and then send the data, and I wrote the signal handler for SIGUSR1 to perform required action. I would like to implement the same way of communication using ZeroMQ and I have been reading their guide to find out, whether ZeroMQ has any kind of

CZMQ : Unable to receive message

给你一囗甜甜゛ 提交于 2019-12-06 07:29:12
I am trying to write a simple program to demonstrate Publisher/Subscriber communication using 'libczmq'. Although I am able to send the message via the 'zmsg_send' api ( or so I presume based on its return value ), I am unable to receive the message via the 'zmsg_recv' (blocking) API, it is probably unable to receive the message. #include "czmq.h" int main (void) { int rc; const char *ipc_file="ipc://tmp.socket"; const char *str = "Hello World!!!"; /*****************************************/ /* Creating and binding publisher Socket */ /*****************************************/ zsock_t *pub

App crashes on iOS 6: Symbol not found: ___sync_fetch_and_add_4

牧云@^-^@ 提交于 2019-12-06 06:36:52
I have an application that works perfectly with iOS4 and iOS5. It uses a statically compiled version of the zeromq library, targeted for ARM. Apple denied my application because they claim it crashes under iOS 6 (yet unreleased..wth?) After trying it with the iOS 6 GM I can confirm it does crash when we initialize the ZeroMQ socket. Here is the crash messages: dyld: lazy symbol binding failed: Symbol not found: ___sync_fetch_and_add_4 Referenced from: /var/mobile/Applications/00EDEEDA-0068-4061-9188-01D627F9A6D6/OpenAir.app/OpenAir Expected in: /usr/lib/libSystem.B.dylib dyld: Symbol not found

Redis pubsub message queue but with callback, as in ZeroMQ

独自空忆成欢 提交于 2019-12-06 06:16:58
I have found the following code that implements an asynchronous message queue (actually there is no queue, only files) with ZeroMQ and Node.js setInterval(function() { var value = { id: i++, date: new Date() }; WriteFile(value.id + ".dat", value); client.send(value, function(result) { console.log(value, result); DeleteFile(value.id + ".dat"); }); }, 10000); The code is from here . The functions "WriteFile" and "DeleteFile" are defined later in the code, but there is nothing extraordinary there. The function "client.send" is also defined in another file, where the callback is defined. Clearly

Class ZMQContext not found

我怕爱的太早我们不能终老 提交于 2019-12-06 06:04:36
I'm running web server on nginx 1.4.6 and php 5.5 inside a virtualized machine with Ubuntu 14.04 and need to install ZeroMQ extension. I have followed the instructions on ZMQ (the section To build on UNIX-like systems ), added php language binding as instructed here , compiled it against my version of php and added the line extension=zmq.so to /etc/php5/cli/php.ini as well as to /etc/php5/fpm/php.ini , which are my only .ini files. After restarting nginx and php-fpm the php -i shows following: $ php -i | grep -i zmq zmq ZMQ extension => enabled ZMQ extension version => @PACKAGE_VERSION@ libzmq