mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-28 00:00:11 +02:00
Migrate to std::futures and the futures 0.3 preview and use async/await where possible **Breaking change:** the IoFuture and IoStream definitions used to refer to Box<dyn Future> and Box<dyn Stream>, but now they are defined as Pin<...> versions which are technically breaking. No other breaking or functional changes have been made
20 lines
363 B
Rust
20 lines
363 B
Rust
#![cfg(unix)]
|
|
#![deny(warnings, rust_2018_idioms)]
|
|
#![feature(async_await)]
|
|
|
|
pub mod support;
|
|
use crate::support::*;
|
|
|
|
use libc;
|
|
|
|
#[tokio::test]
|
|
async fn simple() {
|
|
let signal = with_timeout(Signal::new(libc::SIGUSR1))
|
|
.await
|
|
.expect("failed to create signal");
|
|
|
|
send_signal(libc::SIGUSR1);
|
|
|
|
with_timeout(signal.into_future()).await;
|
|
}
|