rust/src/test/run-pass/pipe-sleep.rs

22 lines
341 B
Rust
Raw Normal View History

2012-07-05 23:14:27 -07:00
extern mod std;
2012-09-05 12:32:05 -07:00
use std::timer::sleep;
use std::uv;
use pipes::recv;
proto! oneshot (
2012-07-05 23:14:27 -07:00
waiting:send {
signal -> !
}
)
fn main() {
use oneshot::client::*;
2012-09-18 22:45:24 -07:00
let c = pipes::spawn_service(oneshot::init, |p| { recv(move p); });
let iotask = uv::global_loop::get();
sleep(iotask, 500);
2012-09-18 22:45:24 -07:00
signal(move c);
}