about summary refs log tree commit diff
path: root/src/libstd/rt/rtio.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-10-28 02:41:18 -0700
committerbors <bors@rust-lang.org>2013-10-28 02:41:18 -0700
commitde3d36a763a09032a68aa9d47071840c8b4dd5a7 (patch)
treea7b4f61e452f2ce8e693ddd671b057f19467fa93 /src/libstd/rt/rtio.rs
parent9ef23e9060d60189894f6d725e6c1c73b887c802 (diff)
parent7a1d97e62cd467596457d850fd5e73f6160159c2 (diff)
downloadrust-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.rs4
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 {