Crate relay [] [src]

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");

Structs

Canceled

Represents that the Sender dropped before sending a message.

Receiver

The receiver end of the channel.

Sender

The Sender portion of a channel.

Waiting

A Future waiting for interest to be registered on the Receiver.

Functions

channel

Create a new channel to send a message.