fix(client): allow shared channel access - #191
Merged
Merged
Conversation
jadamcrain
self-requested a review
August 8, 2026 00:40
jadamcrain
approved these changes
Aug 8, 2026
jadamcrain
left a comment
Member
There was a problem hiding this comment.
Thanks. I will do a milestone release with this change.
jadamcrain
added a commit
that referenced
this pull request
Aug 8, 2026
Milestone to publish only the `rodbus` crate to crates.io for the shared client channel access change (#191). There are no FFI changes, so this milestone is not pushed to Maven/NuGet/docs. Full lockstep version bump 1.6.0-M1 -> 1.6.0-M2 across all crates, FFI binding build files, and the guide. The lockstep bump is required even for a crates.io-only publish: the FFI layer asserts the generated bindings' expected version (rodbus-schema, ffi/rodbus-schema/src/lib.rs) against the native library's runtime version (rodbus::VERSION, via ffi/rodbus-ffi/src/lib.rs), so bumping rodbus alone fails the binding tests in CI. Release process: this does NOT use the tag-driven pipeline (a tag fires all release jobs across every ecosystem). After merge, publish manually from main with `cargo publish -p rodbus`; no git tag is pushed. Binding versions therefore read 1.6.0-M2 in source but stay published at 1.5.0 until the 1.6.0 final re-syncs everything.
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.
Summary
Channel's
read/writemethods andset_decode_levelnow take&selfrather than&mut self. These methods only build a command and send it on the internalmpsc::Sender, so there is nothing to mutate. The existingenableanddisablemethods in the same impl already take&self.The deprecated
CallbackSessionis left unchanged.Motivation
The exclusive borrow never actually enforced exclusivity.
ChannelisClone, so callers that wanted concurrent requests could simply clone the handle. That behavior is safe by design: each request carries its ownoneshot, and the client task serializes commands from the shared channel.What the
&mut selfrequirement did enforce was unnecessary friction for shared ownership patterns. In particular,Arc<Channel>is awkward to use becauseArc<T>only provides&T. As a result, callers have to clone the channel handle for every operation just to satisfy a borrow requirement that does not reflect the implementation.Compatibility
This is source-compatible for normal callers. Existing calls using mutable bindings continue to compile, potentially with an
unused_mutwarning.The deprecated
CallbackSessionand FFI-facing APIs are unchanged.cargo-semver-checksreports: