From 61507ec1fa61fe134547a7eac9541375c6215b33 Mon Sep 17 00:00:00 2001 From: David Blajda Date: Thu, 20 Dec 2018 00:09:49 +0000 Subject: Replace channel based barrier with shared future based barrier --- src/error.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/error.rs') diff --git a/src/error.rs b/src/error.rs index 20563b1..88f2713 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,6 +1,20 @@ use reqwest::Error as ReqwestError; +use futures::future::SharedError; use std::convert::From; +/*TODO: How should condition errors be handled? + * Ultimately the future must resolve so if the condition + * errs than all it's waiters must err. + */ +#[derive(Clone, Debug)] +pub struct ConditionError{} + +impl From> for ConditionError { + fn from(other: SharedError) -> Self { + ConditionError{} + } +} + #[derive(Debug)] enum Kind { Reqwest(ReqwestError), @@ -50,3 +64,12 @@ impl From> for Error { } } } + +impl From for Error { + + fn from(_err: ConditionError) -> Error { + Error { + inner: Kind::ClientError("Oneshot channel unexpectedly closed".to_owned()) + } + } +} -- cgit v1.2.3