Skip to content

Add discovered_readers()/discovered_writers() snapshot accessors - #418

Merged
jhelovuo merged 1 commit into
Atostek:masterfrom
cerulion-inc:cer725-endpoint-snapshot
Aug 3, 2026
Merged

Add discovered_readers()/discovered_writers() snapshot accessors#418
jhelovuo merged 1 commit into
Atostek:masterfrom
cerulion-inc:cer725-endpoint-snapshot

Conversation

@lakshay2010sharma

Copy link
Copy Markdown
Contributor

What

Adds discovered_readers() / discovered_writers() snapshot accessors, mirroring the existing discovered_topics() at all three delegation layers (DomainParticipantDomainParticipantDiscDomainParticipantInner), backed by two new DiscoveryDB getters over the external_topic_readers / external_topic_writers maps.

Why

The status-event channel can lose discovery events for a consumer that attaches late or drains slowly — but DiscoveryDB retains 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_DATA QoS. Since user_data is carried on DiscoveredReaderData / DiscoveredWriterData, these accessors expose remote endpoints' USER_DATA (and the rest of the endpoint QoS) directly from the DB snapshot — we use this to drive type_description_interfaces lookups against live robots.

Notes

  • Additive only — no existing signatures or behavior changed.
  • Snapshot semantics (cloned Vec), same shape as discovered_topics().
  • Includes an in-module DiscoveryDB test + doctests.

Happy to adjust naming/placement to whatever fits the project's conventions.

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.
@jhelovuo

jhelovuo commented Aug 3, 2026

Copy link
Copy Markdown
Member

Thank you for your contribution!

@jhelovuo
jhelovuo merged commit e448344 into Atostek:master Aug 3, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants