Skip to content

feat(watch): allow non-Clone channel values - #313

Merged
tisonkun merged 2 commits into
apache:mainfrom
TayfurYldz:feat/watch-non-clone-channel
Sep 14, 2026
Merged

feat(watch): allow non-Clone channel values#313
tisonkun merged 2 commits into
apache:mainfrom
TayfurYldz:feat/watch-non-clone-channel

Conversation

@TayfurYldz

Copy link
Copy Markdown
Contributor

Summary

  • relax watch::channel so construction, publication, replacement, subscription, and change tracking do not require T: Clone
  • keep Clone localized to Receiver::get and Receiver::recv
  • add focused integration coverage with a non-Clone payload, including send_replace ownership
  • document the contract and changelog entry

Closes #311.

Testing

Repository CI is the authoritative validation for cargo x lint, cargo x check, cargo x bench --no-run, cargo x test --no-capture, and Miri.

Relax watch::channel construction so non-Clone values can be published,
replaced, subscribed to, and observed for changes while keeping Clone
requirements localized to owning reads. Add focused integration coverage
and document the public contract.

Signed-off-by: tayfuryldzz <yildiztayfur668@gmail.com>
Comment thread asyncband/src/watch/mod.rs Outdated
Comment on lines +84 to +85
/// The value type does not need to implement `Clone` for construction, publication, or change
/// notification. Only owning reads through [`Receiver::get`] and [`Receiver::recv`] require it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// The value type does not need to implement `Clone` for construction, publication, or change
/// notification. Only owning reads through [`Receiver::get`] and [`Receiver::recv`] require it.

Too many deatils.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really needed?

Signed-off-by: tayfuryldzz <yildiztayfur668@gmail.com>
@TayfurYldz
TayfurYldz force-pushed the feat/watch-non-clone-channel branch from fe836b3 to a303df5 Compare September 14, 2026 15:29
@TayfurYldz

TayfurYldz commented Sep 14, 2026 via email

Copy link
Copy Markdown
Contributor Author

@tisonkun tisonkun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @TayfurYldz !

Merging...

@tisonkun
tisonkun enabled auto-merge (squash) September 14, 2026 15:41
@tisonkun
tisonkun merged commit 87017f9 into apache:main Sep 14, 2026
9 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.

Relax the Clone bound on watch channel construction

2 participants