Add discovered_readers()/discovered_writers() snapshot accessors#418
Open
lakshay2010sharma wants to merge 1 commit into
Open
Add discovered_readers()/discovered_writers() snapshot accessors#418lakshay2010sharma wants to merge 1 commit into
lakshay2010sharma wants to merge 1 commit into
Conversation
Mirror discovered_topics() at all three delegation layers, backed by two new DiscoveryDB getters over the external_topic_readers/writers maps. Snapshot semantics (cloned Vec): a consumer that attaches late or drains the status-event channel slowly can miss discovery events, but the DiscoveryDB retains full current state. Since user_data is now carried on DiscoveredReaderData/DiscoveredWriterData, these accessors expose remote endpoints' USER_DATA QoS (e.g. ROS 2 REP-2011 type hashes) loss-free. Additive only; in-module DB test + doctests included.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
discovered_readers()/discovered_writers()snapshot accessors, mirroring the existingdiscovered_topics()at all three delegation layers (DomainParticipant→DomainParticipantDisc→DomainParticipantInner), backed by two newDiscoveryDBgetters over theexternal_topic_readers/external_topic_writersmaps.Why
The status-event channel can lose discovery events for a consumer that attaches late or drains slowly — but
DiscoveryDBretains the full current state. A snapshot accessor lets applications harvest remote endpoint discovery loss-free at any point, instead of reconstructing state from an event stream they may have partially missed.Our concrete use case: ROS 2 nodes publish REP-2011 type hashes in endpoint
USER_DATAQoS. Sinceuser_datais carried onDiscoveredReaderData/DiscoveredWriterData, these accessors expose remote endpoints'USER_DATA(and the rest of the endpoint QoS) directly from the DB snapshot — we use this to drivetype_description_interfaceslookups against live robots.Notes
Vec), same shape asdiscovered_topics().DiscoveryDBtest + doctests.Happy to adjust naming/placement to whatever fits the project's conventions.