diff options
| author | bors <bors@rust-lang.org> | 2013-10-28 02:41:18 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-10-28 02:41:18 -0700 |
| commit | de3d36a763a09032a68aa9d47071840c8b4dd5a7 (patch) | |
| tree | a7b4f61e452f2ce8e693ddd671b057f19467fa93 /src/libstd/rt/rtio.rs | |
| parent | 9ef23e9060d60189894f6d725e6c1c73b887c802 (diff) | |
| parent | 7a1d97e62cd467596457d850fd5e73f6160159c2 (diff) | |
| download | rust-de3d36a763a09032a68aa9d47071840c8b4dd5a7.tar.gz rust-de3d36a763a09032a68aa9d47071840c8b4dd5a7.zip | |
auto merge of #10083 : alexcrichton/rust/timer-port, r=pcwalton
In addition to being able to sleep the current task, timers should be able to create ports which get notified after a period of time. Closes #10014
Diffstat (limited to 'src/libstd/rt/rtio.rs')
| -rw-r--r-- | src/libstd/rt/rtio.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstd/rt/rtio.rs b/src/libstd/rt/rtio.rs index 29f728a5e0c..366388063d4 100644 --- a/src/libstd/rt/rtio.rs +++ b/src/libstd/rt/rtio.rs @@ -11,7 +11,7 @@ use libc; use option::*; use result::*; -use comm::SharedChan; +use comm::{SharedChan, PortOne, Port}; use libc::c_int; use c_str::CString; @@ -162,6 +162,8 @@ pub trait RtioUdpSocket : RtioSocket { pub trait RtioTimer { fn sleep(&mut self, msecs: u64); + fn oneshot(&mut self, msecs: u64) -> PortOne<()>; + fn period(&mut self, msecs: u64) -> Port<()>; } pub trait RtioFileStream { |
