summaryrefslogtreecommitdiff
path: root/src/sync/waiter.rs
diff options
context:
space:
mode:
authorDavid Blajda <blajda@hotmail.com>2018-12-19 16:14:14 +0000
committerDavid Blajda <blajda@hotmail.com>2018-12-19 16:14:14 +0000
commit17893388feed5f91ebd254ac7ad8e2801ca8a6d0 (patch)
treec4fb2710eb264562aa3721dadf5f43b183c6f42d /src/sync/waiter.rs
parentfbee478ad333732982f7e0eecdcc3681a6d71f2f (diff)
Place barrier and waiters in their own modules
Diffstat (limited to 'src/sync/waiter.rs')
-rw-r--r--src/sync/waiter.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sync/waiter.rs b/src/sync/waiter.rs
new file mode 100644
index 0000000..656c42e
--- /dev/null
+++ b/src/sync/waiter.rs
@@ -0,0 +1,13 @@
+use futures::sync::oneshot;
+use futures::Future;
+
+pub trait Waiter {
+ type Item: Send + 'static;
+ type Error: From<Self::ConditionError>
+ + From<oneshot::Canceled> + From<()> + Send + 'static;
+ type ConditionError: Send + Clone + 'static;
+
+ 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>;
+}