diff options
author | David Blajda <blajda@hotmail.com> | 2018-12-20 00:09:49 +0000 |
---|---|---|
committer | David Blajda <blajda@hotmail.com> | 2018-12-20 00:09:49 +0000 |
commit | 61507ec1fa61fe134547a7eac9541375c6215b33 (patch) | |
tree | cf7fb84300454680dd0acd06434fa23a71d6211f /src/sync/waiter.rs | |
parent | a8e42248cf617767dfd890c0832ea233bb4608fc (diff) |
Replace channel based barrier with shared future based barrier
Diffstat (limited to 'src/sync/waiter.rs')
-rw-r--r-- | src/sync/waiter.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sync/waiter.rs b/src/sync/waiter.rs index 656c42e..8039280 100644 --- a/src/sync/waiter.rs +++ b/src/sync/waiter.rs @@ -1,13 +1,13 @@ use futures::sync::oneshot; use futures::Future; +use futures::future::{Shared, SharedError}; +use crate::error::ConditionError; pub trait Waiter { - type Item: Send + 'static; - type Error: From<Self::ConditionError> - + From<oneshot::Canceled> + From<()> + Send + 'static; - type ConditionError: Send + Clone + 'static; + type Item: Default; + type Error: From<SharedError<ConditionError>>; fn blocked(&self) -> bool; - fn condition_poller(&self) -> Box<Future<Item=(), Error=Self::ConditionError> + Send>; - fn into_future(self) -> Box<Future<Item=Self::Item, Error=Self::Error> + Send>; + fn condition(&self) + -> Shared<Box<Future<Item=(), Error=ConditionError> + Send>>; } |