mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-03 00:00:05 +02:00
sync: document when watch::send fails (#4021)
This commit is contained in:
@@ -422,6 +422,9 @@ impl<T> Drop for Receiver<T> {
|
|||||||
|
|
||||||
impl<T> Sender<T> {
|
impl<T> Sender<T> {
|
||||||
/// Sends a new value via the channel, notifying all receivers.
|
/// Sends a new value via the channel, notifying all receivers.
|
||||||
|
///
|
||||||
|
/// This method fails if the channel has been closed, which happens when
|
||||||
|
/// every receiver has been dropped.
|
||||||
pub fn send(&self, value: T) -> Result<(), error::SendError<T>> {
|
pub fn send(&self, value: T) -> Result<(), error::SendError<T>> {
|
||||||
// This is pretty much only useful as a hint anyway, so synchronization isn't critical.
|
// This is pretty much only useful as a hint anyway, so synchronization isn't critical.
|
||||||
if 0 == self.shared.ref_count_rx.load(Relaxed) {
|
if 0 == self.shared.ref_count_rx.load(Relaxed) {
|
||||||
|
|||||||
Reference in New Issue
Block a user