Is there a way to cancel published messages from a latched publisher

asked 2020-08-17 15:09:54 -0500

azerila gravatar image

we have a latched publisher that has already published a few messages. Is there a way to cancel these published messages so that the newly made subscriber would not receive them to call it's callback?

or is there a way to destroy the publisher so that those messages will also vanish?

edit retag flag offensive close merge delete

Comments

Latched publishers only provide the last message they've published to late joiners, not multiple.

Could you please clarify and/or provide an MWE?

gvdhoorn gravatar image gvdhoorn  ( 2020-08-18 01:22:35 -0500 )edit

@gvdhoorn The main problem I think he is having is dealing with multiple callbacks calls when expecting one because the publisher is latched. If the publisher is latched and you restart the node subscriber the callback is called again because this new connection. @azerila If that is the problem I have a similar issue in the past and I solved here, just processing the callback depending on the elapsed time between messages.

Weasfas gravatar image Weasfas  ( 2020-08-18 05:10:57 -0500 )edit