allwpilib
allwpilib copied to clipboard
Closing NetworkTables publisher doesn't flush queued data
Describe the question you have. Consider the following code:
try (var publisher = topic.publish()) {
publisher.set(value);
}
Shouldn't remote subscribers (eventually) see the new value? My testing seems to indicate that they might not see it unless inst.flushLocal()
(or inst.flush()
) is called before the publisher is (auto-)closed. That seems to hold independent of any PubSubOption
s associated with the publisher or whether the topic is cached . Is that intentional?
Describe the reason for your confusion. The current behavior was just not what I expected. If it is intentional, it should probably be better documented.