ctrl+C example: Prompt user to do something.

So we don't stay at a blank terminal without any feedback after `cargo run`
This commit is contained in:
Jules Kerssemakers
2017-06-07 21:18:26 +02:00
parent 0ee0b93798
commit a7efdd051b
+2
View File
@@ -10,6 +10,8 @@ fn main() {
let ctrlc = tokio_signal::ctrl_c(&core.handle());
let stream = core.run(ctrlc).unwrap();
println!("This program is now waiting for you to press Ctrl+C");
core.run(stream.for_each(|()| {
println!("Ctrl-C received!");
Ok(())