I'm using ZeroMQ publish–subscribe sockets to connect two processes. The publishing process is a sensor, and has a much faster refresh rate than the subscription process. I want the subscription process to only use the most recent message in the queue — and ignore older messages altogether.
I've tried setting a highwater mark on the subscriber, but that seems to drop newer messages rather than older.
Is there a publish–subscribe pattern someone can direct me toward for this purpose?