From 58e816e36e7dc73fdf5ac5aa42add35b1225cb20 Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Wed, 20 May 2020 22:24:25 +0200 Subject: [PATCH] fix broken sentence (#51) --- src/server.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/server.rs b/src/server.rs index 5fc3838..5c36c45 100644 --- a/src/server.rs +++ b/src/server.rs @@ -129,8 +129,11 @@ const MAX_CONNECTIONS: usize = 250; /// `tokio::signal::ctrl_c()` can be used as the `shutdown` argument. This will /// listen for a SIGINT signal. pub async fn run(listener: TcpListener, shutdown: impl Future) -> crate::Result<()> { - // A broadcast channel is used to signal shutdown to each of the active - // connections. When the provided `shutdown` future completes + // When the provided `shutdown` future completes, we must send a shutdown + // message to all active connections. We use a broadcast channel for this + // purpose. The call below ignores the receiver of the broadcast pair, and when + // a receiver is needed, the subscribe() method on the sender is used to create + // one. let (notify_shutdown, _) = broadcast::channel(1); let (shutdown_complete_tx, shutdown_complete_rx) = mpsc::channel(1);