signal: Replace ctrl_c with a CtrlC struct (#1273)

* Add a new `CtrlC` struct which will represent a stream of SIGINT
signals on Unix or the CTRL_C event on Windows
* `CtrlC` implements `Stream<Output = ()>` rather than `IoSteam` as
previously
This commit is contained in:
Ivan Petkov
2019-07-09 08:48:46 -07:00
committed by GitHub
parent 407d15cf93
commit 461eebe612
13 changed files with 129 additions and 116 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ fn multi_loop() {
let mut rt = CurrentThreadRuntime::new().unwrap();
let signal = run_with_timeout(&mut rt, Signal::new(libc::SIGHUP)).unwrap();
sender.send(()).unwrap();
run_with_timeout(&mut rt, signal.into_future());
let _ = run_with_timeout(&mut rt, signal.into_future());
})
})
.collect();