Repository navigation
feat(zenoh): one session for ZenohConnector and its Ros2Connector (design 053 s11) - #313
Merged
Merged
Conversation
`zenoh.ros2(node)` returns a Ros2Connector on the ZenohConnector's session: one router connection for `zenoh://` and `ros2://`. `Ros2Connector::new` still owns a session of its own. Each connector's build() validates its links and leaves its parts in `Shared`; the first build() returns the session task, the other none. The task opens the session, then serves both views' parts in one future. A `.ros2(..)` view that is never registered is logged and skipped; two views on one session both claim `ros2` and core refuses them. Tests count TCP connections through a proxy: the gateway (zenoh:// in, ros2:// out) opens one in either registration order, and two separate connectors open two. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Stage s11 of
docs/design/053-implementation-plan.md: one session for both schemes (053 §4.7). Meets criterion 8.What it adds
ZenohConnector::ros2(&self, node): aRos2Connectoron the same session.Ros2Connector::newstill opens a session of its own.Shared(src/shared.rs,stdonly) holds the endpoint and config, one build-time slot per view, and a flag for the session task.build()validates exactly as before, then leaves its parts in its slot.build()returns the session task; the other returns no futures.tokio::join!).AimDbBuilderruns everybuild()before it polls anything, so both parts are there in time.open()moved intoZenohParts::serveandRos2Parts::serve. Behaviour is unchanged, and the s08–s10 suites pass as they were..ros2(..)view that's never registered is logged once and skipped; the Zenoh side runs normally..ros2(..)views on one session both claim theros2scheme, so core's existing owned-scheme check refuses them. One ROS node per session, as 053 §4.7 says.with_zenoh_configon either view configures the shared session.Tests (
tests/shared_session.rs)A TCP proxy in front of an in-process router counts every connection the database opens.
zenoh://cell4/probe/temperatureput comes out as a ROS sample on7/cell4/temperature/…with its 33-byte attachment; 1 connectionZenohConnectorplus a separateRos2Connector::new.ros2(..)viewzenoh://publishing still works.ros2(..)views registeredbuild()refuses themDesign change
053 §4.7 said
Sharedwould hold core'ssession::OneShot. A flag inShareddoes the same job, andOneShotsits behind core'sconnector-sessionfeature, which this crate doesn't need. 053 §4.7 now says so and cites the test.Checks
The full matrix runs in CI. Locally, as a quick signal: the library tests (22),
shared_session(5),native_session(7),ros2_inbound(3),ros2_outbound(5), the embeddedcargo check, andcargo fmt --all -- --check.🤖 Generated with Claude Code