pub fn channel<T>() -> (Sender<T>, Receiver<T>) {
    let inner = Rc::new(RefCell::new(Inner {
        value: None,
        read_task: None,
        cancel_task: None,
    }));
    return (Sender { inner: Rc::downgrade(&inner) },
            Receiver { inner: inner });
}
/// Creates an in-memory Stream which only preserves last value
///
/// This method is somewhat similar to `channel(1)` but instead of preserving
/// first value sent (and erroring on sender side) it replaces value if
/// consumer is not fast enough and preserves last values sent on any
/// poll of a stream.
///
/// # Example
///
/// ```
/// extern crate futures;
/// extern crate async_slot;
///
/// use futures::prelude::*;
/// use futures::stream::iter_ok;
///
/// # fn main() {
/// let (tx, rx) = async_slot::unsync::channel::<i32>();
///
/// tx.send_all(iter_ok(vec![1, 2, 3])).wait();
///
/// let received = rx.collect().wait().unwrap();
/// assert_eq!(received, vec![3]);
/// # }
/// ```
Creates an in-memory Stream which only preserves last value
This method is somewhat similar to `channel(1)` but instead of preserving
first value sent (and erroring on sender side) it replaces value if
consumer is not fast enough and preserves last values sent on any
poll of a stream.
Creates an in - memory Stream which only preserves last value This method is somewhat similar to ` channel ( 1 ) ` but instead of preserving first value sent ( and erroring on sender side ) it replaces value if consumer is not fast enough and preserves last values sent on any poll of a stream .
pub fn channel<T>() -> (Sender<T>, Receiver<T>) {
    let inner = Rc::new(RefCell::new(Inner {
        value: None,
        read_task: None,
        cancel_task: None,
    }));
    return (Sender { inner: Rc::downgrade(&inner) },
            Receiver { inner: inner });
}
pub fn channel < T > ( ) -> ( Sender < T > , Receiver < T > ) { let inner = Rc :: new ( RefCell :: new ( Inner { value : None , read_task : None , cancel_task : None , } ) ) ; return ( Sender { inner : Rc :: downgrade ( & inner ) } , Receiver { inner : inner } ) ; }
Creates an in-memory Stream which only preserves last value
This method is somewhat similar to `channel(1)` but instead of preserving
first value sent (and erroring on sender side) it replaces value if
consumer is not fast enough and preserves last values sent on any
poll of a stream.
Creates an in - memory Stream which only preserves last value This method is somewhat similar to ` channel ( 1 ) ` but instead of preserving first value sent ( and erroring on sender side ) it replaces value if consumer is not fast enough and preserves last values sent on any poll of a stream .
example
```
extern crate futures;
extern crate async_slot.

use futures::prelude::*;
use futures::stream::iter_ok.
` ` ` extern crate futures ; extern crate async_slot . use futures :: prelude :: * ; use futures :: stream :: iter_ok .
fn main() {
let (tx, rx) = async_slot::unsync::channel::().



let received = rx.collect().wait().unwrap();
assert_eq!(received, vec![3]).
let ( tx rx ) = async_slot :: unsync :: channel :: () . let received = rx . collect () . wait () . unwrap () ; assert_eq! ( received vec! [ 3 ] ) .
}
None