#futures #channel

relay

A lightweight oneshot Future channel

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

#395 in Asynchronous

Download history 2532/week @ 2020-10-31 3256/week @ 2020-11-07 3017/week @ 2020-11-14 3122/week @ 2020-11-21 3007/week @ 2020-11-28 3460/week @ 2020-12-05 3255/week @ 2020-12-12 2376/week @ 2020-12-19 2214/week @ 2020-12-26 3803/week @ 2021-01-02 4798/week @ 2021-01-09 3997/week @ 2021-01-16 3659/week @ 2021-01-23 3782/week @ 2021-01-30 4200/week @ 2021-02-06 3605/week @ 2021-02-13

14,107 downloads per month

MIT/Apache

10KB
233 lines

relay

Build Status crates.io

A light-weight Future channel for passing data among tasks.

Documentation

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

# extern crate futures;
# extern crate relay;
# use futures::Future;
# fn main() {
let (tx, rx) = relay::channel();
tx.complete("foo");
assert_eq!(rx.wait().unwrap(), "foo");
# }

Dependencies

~36KB