summary refs log tree commit diff
path: root/src/libstd/rt/rtio.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-10-25 21:55:10 -0700
committerAlex Crichton <alex@alexcrichton.com>2013-10-25 22:12:55 -0700
commit7a1d97e62cd467596457d850fd5e73f6160159c2 (patch)
treedb458c437467ccc81610a13ea48fe551ca3c57e1 /src/libstd/rt/rtio.rs
parentbaeed886aa64943ad48121cc3b57dabec12bc835 (diff)
downloadrust-7a1d97e62cd467596457d850fd5e73f6160159c2.tar.gz
rust-7a1d97e62cd467596457d850fd5e73f6160159c2.zip
Enhance timers to create ports
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 {