Fix some comments in the examples. (#187)

The PR that updated the examples skipped some comments. This patch
updates thhe comments.
This commit is contained in:
Carl Lerche
2018-03-06 12:00:49 -08:00
committed by GitHub
parent ae20270d00
commit 869615f1d2
2 changed files with 16 additions and 34 deletions
+7 -14
View File
@@ -54,22 +54,15 @@ pub fn main() {
println!("server running on localhost:6142");
// This starts the `current_thread` executor.
// Start the Tokio runtime.
//
// Executors are responsible for scheduling many asynchronous tasks, driving
// them to completion. There are a number of different executor
// implementations, each providing different scheduling characteristics.
// The Tokio is a pre-configured "out of the box" runtime for building
// asynchronous applications. It includes both a reactor and a task
// scheduler. This means applications are multithreaded by default.
//
// The `current_thread` executor multiplexes all scheduled tasks on the
// current thread. This means that spawned tasks must not implement `Send`.
// It's important to note that all futures / tasks are lazy. No work will
// happen unless they are spawned onto an executor.
//
// The executor will start running the `server` task, which, in turn, spawns
// new tasks for each incoming connection.
//
// The `current_thread::block_on_all` function will block until *all*
// spawned tasks complete.
// This function blocks until the runtime reaches an idle state. Idle is
// defined as all spawned tasks have completed and all I/O resources (TCP
// sockets in our case) have been dropped.
//
// In our example, we have not defined a shutdown strategy, so this will
// block until `ctrl-c` is pressed at the terminal.