3 unstable releases
Uses old Rust 2015
0.1.1 | Jan 31, 2018 |
---|---|
0.1.0 | Dec 31, 2016 |
0.0.0 | Dec 31, 2016 |
#1903 in Asynchronous
3,149 downloads per month
10KB
233 lines
relay
A light-weight Future
channel for passing data among tasks.
License
Licensed under either of
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
lib.rs
:
relay
A light-weight channel using Future
. A relay channel does not implement
Send
, and so is not meant for synchronizing between threads. Instead,
its used to send message between tasks that live in the same thread.
It is similar to the oneshot
channel in the futures
crate, but since
it is not meant for sending across threads, it performs about twice as
fast.
Example
let (tx, rx) = relay::channel();
tx.complete("foo");
assert_eq!(rx.wait().unwrap(), "foo");
Dependencies
~53KB