[zeromq-dev] Feedback on new PATCH socket
fabien.ninoles at ubisoft.com
Sun May 8 20:17:40 CEST 2011
OK, I give a second look to the collector pattern I wrote and build a basic prototype using a variation on the LRU queue. I would send the proto once I get access to a computer where I can test it (my N900 doesn't have a pyzmq package and the debian package depends on a more recent toolchain) but here what I can tell from the implementation:
- I don't need PATCH for this implementation, only XREP/XREQ.
- The sockets MUST be connect to a single collector device backend. Sharing them with mutiple collectors make the timeout unpredictable because of dependency on the queue size. Corrolary: only one request can be handle all the time, which is OK since all workers are busy by definition.
- The timeout must be at least the total of roundtrip time plus the maximum time for treating of a single request. It is possible to send this value for each request (which also permit the worker to abort it's job if it takes too long).
PATCH socket can still be useful for implementing a command channel over unidirectional parallel async streams (something like the mongrel2 pattern). Using one socket for this make it more reliable than using two different sockets, but I think this can also be done with the subport feature, no ?
More information about the zeromq-dev