Hi, It sounds like you need logic similar to a jitter buffer, which is commonly used in RTP media streaming (voip / TV airwaves). Basically, you have a time buffer (say 300 milliseconds) that timestamped messages are held in before processing. Each message sits in this queue for the defined time limit, and if any other messages arrive during that time then the messages are sorted by their timestamps. Once the time limit elapses for a message, it becomes available for reading. Note that this approach introduces a fixed amount of latency (e.g. in the case of a 300ms buffer, messages will run 300ms behind). I don't have any libraries to suggest, but you might look around for jitter buffer implementations as inspiration. Justin
On Wed, Dec 6, 2017, at 03:55 AM, Francesco wrote: > Hi all, > As you know when using PUB/SUB model the order of arrival of messages > at SUB-side cannot be garantueed and generally speaking, the SUB will > receive messages out of order. This is a well known problem, see e.g.:> > https://cloud.google.com/pubsub/docs/ordering > > My question is: in case in the SUB you need strict time ordering, are > you aware of any good C++ implementation of a reordering queue?> > I used for other purposes moodycamel's queue > (http://moodycamel.com/blog/2013/a-fast-lock-free-queue-for-c++) which > is thread-safe but it does not perform time-reordering.> > Thanks! > > Francesco > > > _________________________________________________ > zeromq-dev mailing list > [email protected] > https://lists.zeromq.org/mailman/listinfo/zeromq-dev
_______________________________________________ zeromq-dev mailing list [email protected] https://lists.zeromq.org/mailman/listinfo/zeromq-dev
