Skip to content

Commit 58e816e

Browse files
authored
fix broken sentence (#51)
1 parent 4c9ef8b commit 58e816e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/server.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,11 @@ const MAX_CONNECTIONS: usize = 250;
129129
/// `tokio::signal::ctrl_c()` can be used as the `shutdown` argument. This will
130130
/// listen for a SIGINT signal.
131131
pub async fn run(listener: TcpListener, shutdown: impl Future) -> crate::Result<()> {
132-
// A broadcast channel is used to signal shutdown to each of the active
133-
// connections. When the provided `shutdown` future completes
132+
// When the provided `shutdown` future completes, we must send a shutdown
133+
// message to all active connections. We use a broadcast channel for this
134+
// purpose. The call below ignores the receiver of the broadcast pair, and when
135+
// a receiver is needed, the subscribe() method on the sender is used to create
136+
// one.
134137
let (notify_shutdown, _) = broadcast::channel(1);
135138
let (shutdown_complete_tx, shutdown_complete_rx) = mpsc::channel(1);
136139

0 commit comments

Comments
 (0)