Merge pull request #49 from jeffesquivels/update_comment

Update comment to reflect current code
pull/1/head
Daniel Abramov 6 years ago committed by GitHub
commit b2eaf03876
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      examples/server.rs

@ -42,8 +42,8 @@ fn main() {
let socket = TcpListener::bind(&addr).unwrap(); let socket = TcpListener::bind(&addr).unwrap();
println!("Listening on: {}", addr); println!("Listening on: {}", addr);
// This is a single-threaded server, so we can just use Rc and RefCell to // Tokio Runtime uses a thread pool based executor by default, so we need
// store the map of all connections we know about. // to use Arc and Mutex to store the map of all connections we know about.
let connections = Arc::new(Mutex::new(HashMap::new())); let connections = Arc::new(Mutex::new(HashMap::new()));
let srv = socket.incoming().for_each(move |stream| { let srv = socket.incoming().for_each(move |stream| {

Loading…
Cancel
Save