Ask Your Question

Revision history [back]

If this is actually static, i.e. not changing at all, or at least just very infrequently, it would be best to just publish it in the beginning (make sure, that there is enough time from creating your publisher to actually publish it) and latch it. And then just let the node do nothing.

This way you don't produce any traffic on the topic ("continuous publishing") when it is not needed, and you don't need to check the connections all the time ("publish once when connected"). So this would make your code even more simple.

I'm not sure, but I guess you cannot exit the node when doing this though, as this will also deregister the publisher and thus, even though latched, it will not send the data to new nodes. So

If this is actually static, i.e. not changing at all, or at least just very infrequently, it would be best to just publish it in the beginning (make sure, that there is enough time from creating your publisher to actually publish it) and latch it. And then just let the node do nothing.

This way you don't produce any traffic on the topic ("continuous publishing") when it is not needed, and you don't need to check the connections all the time ("publish once when connected"). So this would make your code even more simple.

I'm not sure, but I guess you cannot exit the node when doing this though, as this will also deregister the publisher and thus, even though latched, it will not send the data to new nodes. So nodes.