allwpilib icon indicating copy to clipboard operation
allwpilib copied to clipboard

Closing NetworkTables publisher doesn't flush queued data

Open brettle opened this issue 2 months ago • 3 comments

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 PubSubOptions 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.

brettle avatar Jun 12 '24 21:06 brettle