diff options
| author | toddaaro <github@opprobrio.us> | 2013-08-16 13:41:30 -0700 |
|---|---|---|
| committer | toddaaro <github@opprobrio.us> | 2013-08-16 16:37:09 -0700 |
| commit | f83835b0e7680188b46db5869f49672fef33ff40 (patch) | |
| tree | 1406a0624c0ad95dd6e59ebe7af667bc26413551 /src/libstd/rt/rtio.rs | |
| parent | 88d8baa76b0c03f6aceeb1f92120af664047ac02 (diff) | |
| download | rust-f83835b0e7680188b46db5869f49672fef33ff40.tar.gz rust-f83835b0e7680188b46db5869f49672fef33ff40.zip | |
Moved the logic for a pausible idle callback into a new type - PausibleIdleCallback and placed the appropriate signatures in rtio and implementation into uvio.
Diffstat (limited to 'src/libstd/rt/rtio.rs')
| -rw-r--r-- | src/libstd/rt/rtio.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libstd/rt/rtio.rs b/src/libstd/rt/rtio.rs index a7c794fb5f1..e29c30ba033 100644 --- a/src/libstd/rt/rtio.rs +++ b/src/libstd/rt/rtio.rs @@ -24,10 +24,12 @@ pub type RtioTcpStreamObject = uvio::UvTcpStream; pub type RtioTcpListenerObject = uvio::UvTcpListener; pub type RtioUdpSocketObject = uvio::UvUdpSocket; pub type RtioTimerObject = uvio::UvTimer; +pub type PausibleIdleCallback = uvio::UvPausibleIdleCallback; pub trait EventLoop { fn run(&mut self); fn callback(&mut self, ~fn()); + fn pausible_idle_callback(&mut self) -> ~PausibleIdleCallback; fn callback_ms(&mut self, ms: u64, ~fn()); fn remote_callback(&mut self, ~fn()) -> ~RemoteCallbackObject; /// The asynchronous I/O services. Not all event loops may provide one @@ -35,11 +37,12 @@ pub trait EventLoop { } pub trait RemoteCallback { - /// Trigger the remote callback. Note that the number of times the callback - /// is run is not guaranteed. All that is guaranteed is that, after calling 'fire', - /// the callback will be called at least once, but multiple callbacks may be coalesced - /// and callbacks may be called more often requested. Destruction also triggers the - /// callback. + /// Trigger the remote callback. Note that the number of times the + /// callback is run is not guaranteed. All that is guaranteed is + /// that, after calling 'fire', the callback will be called at + /// least once, but multiple callbacks may be coalesced and + /// callbacks may be called more often requested. Destruction also + /// triggers the callback. fn fire(&mut self); } |
