[zeromq-dev] External Event Loop

Praveen Baratam praveen.baratam+zmq at gmail.com
Wed Dec 15 19:20:27 CET 2010


Hello All,

I started working on the external event loop integration for ZMQ sockets
using getsocketopt and ZMQ_FD. I am using a wrapper around Libev for the OS
specific event loop abstraction.

But the event loop is not working on FDs from ZMQ sockets. Its not returning
any events. Given below is a schematic diagram of the logic.

Task Ventillator:

   1. Uses XREP/Router Socket bound to inproc://pipeline
   2. Sends named tasks as messages to named workers. (Different from
   PUSH-PULL approach)
   3. Uses a dedicated thread and sends messages in a blocking loop.

Task Workers:

   1. Many named XREQ sockets (with specific identities) represent various
   endpoints for various named tasks.
   2. Connected to inproc://pipeline
   3. Every socket is instantiated on the same thread
   4. ZMQ_FD is supplied to the event loop to watch for events.
   5. On event a callback is made in the same thread that created all the
   sockets and with in that call back a nonblocking recv is made on the socket.


Problem is that no events are collected by the event loop. The event loop is
tested seperately and its working fine but nothing happens with FDs from
ZMQ_XREQ sockets.

When using "inproc" transport, can some sockets be used in a blocking loop
on a dedicated thread while others polled using the ZMQ_FD approach on a
common thread?

Regards,

Praveen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20101215/6ed9197f/attachment.htm>


More information about the zeromq-dev mailing list