[zeromq-dev] Feedback on new PATCH socket
fabien.ninoles at ubisoft.com
Fri May 6 20:00:37 CEST 2011
The new patch socket works great. I test in on Windows, with simple prototype, both with inproc and tcp. My prototype is written in python (with a custom ctypes binding) and start around 150 threads connecting in a five-level hierarchy, with 3 middlelevel devices, and 5 differents entry points to all nodes. Everything want well and the PATCH greatly simplify the initial design.
The basic pipeline is like this (frontend on left, backend on right).
| AREQ | <-> | ROUTER | PATCH | <-> | ROUTER | PATCH | <-> | ROUTER | DEALER | <-> | AREP |
The devices are simple queuing device, with the specify sockets (I don't use zmq device, but for no other reason than debugging and test control).
AREQ sockets are simple XREP wrappers that add a delimiter on each send and remove it on each recv.
AREP sockets are simple XREQ wrappers that crop and save the address stack of receive messages, prepend the last one on each send.
BTW, the last two sockets served me a lot previously, mainly in asynchronous context (where the A came from) where I have to keep our old worker spanning code instead of ZMQ broker. With PATCH, however, it seems to become a normal pattern, especially AREQ which is necessary the moment you need to connect more than one endpoint to a PATCH socket. Could we consider to add it in the standard socket types ?
More information about the zeromq-dev