I would like to implement the divide-and-conquer pattern http://zguide.zeromq.org/page:all#Divide-and-Conquer but with the difference that the sink would get the results in a specific order. In more detail, the ventilator would receive timestamped events and then dispatch them to workers. The sink should be able to queue in its output the events processed by the workers in the exact order received by the ventilator. I don't mind the additional latency incurred by this as I have multiple events arriving at the ventilator almost concurrently and the process time in the workers is practically fixed. I plan to distribute the events to workers randomly or using a back-pressure to keep the length of messages in each worker small.
I though of publishing the pair timestamp/assigned_worker_id from the ventilator directly to the sink and then looping the sink until the pair I want is ready to be pulled. In a similar manner, I could make a REQ/REP between the workers and the sink (but not sure which would make the REQ yet). Any simpler idea I don't see? Many thanks in advance, filimon