use Future;
/// An Async Promise
///
/// A promise can be resolved or rejected, either consumes the promise. The
/// consumer is a future that can be `.await`ed.
///
/// ```
/// use promise_out::{Promise, pair::Producer};
/// use futures::executor::block_on;
/// use std::thread;
/// let (promise, consumer) = Producer::<String, String>::new();
///
/// let task1 = thread::spawn(move || block_on(async {
/// println!("Received {:?}", consumer.await);
/// }));
/// promise.resolve("Hi".into());
/// task1.join().expect("The task1 thread has panicked.");
/// ```