Function tokio_core::channel::channel
[−]
[src]
pub fn channel<T>(handle: &Handle) -> Result<(Sender<T>, Receiver<T>)> where T: Send + 'static
Deprecated since 0.1.1
: use futures::sync::mpsc
instead
Creates a new in-memory channel used for sending data across Send + 'static
boundaries, frequently threads.
This type can be used to conveniently send messages between futures.
Unlike the futures crate channel
method and types, the returned tx/rx
pair is a multi-producer single-consumer (mpsc) channel with no
backpressure. Currently it's left up to the application to implement a
mechanism, if necessary, to avoid messages piling up.
The returned Sender
can be used to send messages that are processed by
the returned Receiver
. The Sender
can be cloned to send messages
from multiple sources simultaneously.