ZeroMQ: I want Publish–Subscribe to drop older messages in favor of newer ones

前端 未结 2 646
无人共我
无人共我 2021-01-19 18:11

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

2条回答
  •  生来不讨喜
    2021-01-19 18:39

    read about the conflate feature from documentation on zeromq (it is kind of new), I think it is exactly what you want.

    From the documentation:

    ZMQ_CONFLATE: Keep only last message If set, a socket shall keep only one message in its inbound/outbound queue, this message being the last message received/the last message to be sent. Ignores 'ZMQ_RCVHWM' and 'ZMQ_SNDHWM' options. Does not support multi-part messages, in particular, only one part of it is kept in the socket internal queue.

提交回复
热议问题