mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
signal: Change constructors to return a result instead of lazy future (#1340)
This commit is contained in:
@@ -11,8 +11,8 @@ mod platform {
|
||||
|
||||
pub async fn main() {
|
||||
// Create a stream for each of the signals we'd like to handle.
|
||||
let sigint = Signal::new(SIGINT).await.unwrap().map(|_| SIGINT);
|
||||
let sigterm = Signal::new(SIGTERM).await.unwrap().map(|_| SIGTERM);
|
||||
let sigint = Signal::new(SIGINT).unwrap().map(|_| SIGINT);
|
||||
let sigterm = Signal::new(SIGTERM).unwrap().map(|_| SIGTERM);
|
||||
|
||||
// Use the `select` combinator to merge these two streams into one
|
||||
let stream = stream::select(sigint, sigterm);
|
||||
|
||||
Reference in New Issue
Block a user