From 6c3b8a5137132b3d7114560d2ec8edcc7450eacc Mon Sep 17 00:00:00 2001 From: Jeffrey Esquivel S Date: Sat, 11 Aug 2018 12:11:57 +0200 Subject: [PATCH] Update comment to reflect current code --- examples/server.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/server.rs b/examples/server.rs index 713c1ae..1a3dfce 100644 --- a/examples/server.rs +++ b/examples/server.rs @@ -42,8 +42,8 @@ fn main() { let socket = TcpListener::bind(&addr).unwrap(); println!("Listening on: {}", addr); - // This is a single-threaded server, so we can just use Rc and RefCell to - // store the map of all connections we know about. + // Tokio Runtime uses a thread pool based executor by default, so we need + // to use Arc and Mutex to store the map of all connections we know about. let connections = Arc::new(Mutex::new(HashMap::new())); let srv = socket.incoming().for_each(move |stream| {