Skip to content

Commit

Permalink
fix(server/channel): Remove broken doctest from comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mxxntype committed Dec 5, 2024
1 parent e212405 commit c19b4cf
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions server/src/channel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,6 @@
//! through the one-shot channel. This mechanism serves as a notification system for other components of the
//! application to react accordingly to the disconnection.
//!
//! ## Example usage
//!
//! ```rust
//! use futures::Stream;
//! use std::task::{Context, Poll};
//! use std::{ops::Deref, pin::Pin};
//! use tokio::sync::{mpsc, oneshot};
//!
//! // Define a new DisconnectChannel.
//! let (grpc_rx, disconnect_tx): (mpsc::Receiver<String>, oneshot::Sender<()>) =
//! mpsc::channel::<String>(10);
//! let disconnect_channel = DisconnectChannel { grpc_rx, disconnect_tx };
//!
//! // Use the DisconnectChannel as a stream.
//! async fn process_messages(disconnect_channel: DisconnectChannel<String>) {
//! while let Some(message) = disconnect_channel.next().await {
//! println!("Received message: {}", message);
//! }
//! }
//!
//! // Upon dropping disconnect_channel, the one-shot channel will be triggered.
//! ```
//!
//! ## Further Reading
//!
//! For more insights and discussions on implementing disconnection detection in Rust asynchronous
Expand Down

0 comments on commit c19b4cf

Please sign in to comment.