tokio-rs / tokio

A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
https://tokio.rs
MIT License
25.44k stars 2.3k forks source link

Add sync::watch::Sender::same_channel() #6637

Closed uklotzde closed 3 weeks ago

uklotzde commented 3 weeks ago

Align the API with sync::broadcast::Sender by adding the missing fn same_channel() method.

Motivation

Now that the Sender implements Clone this is useful.

Solution

Duplicate the Receiverss implementation.