/// Creates a bounded mpsc channel for communicating between asynchronous tasks.
///
/// Being bounded, this channel provides backpressure to ensure that the sender
/// outpaces the receiver by only a limited amount. The channel's capacity is
/// equal to `buffer`. In other words, there are
/// `buffer` "first come, first serve" slots available to all senders.
///
/// The [`Receiver`](Receiver) returned implements the
/// [`Stream`](Stream) trait, while [`Sender`](Sender)
/// has its own method, [`send`][Sender::send].
Creates a bounded mpsc channel for communicating between asynchronous tasks.
Being bounded, this channel provides backpressure to ensure that the sender
outpaces the receiver by only a limited amount. The channel's capacity is
equal to `buffer`. In other words, there are
`buffer` "first come, first serve" slots available to all senders.


Creates a bounded mpsc channel for communicating between asynchronous tasks . Being bounded this channel provides backpressure to ensure that the sender outpaces the receiver by only a limited amount . The channel ' s capacity is equal to ` buffer ` . In other words there are ` buffer ` " first come first serve " slots available to all senders .
pub fn channel<T>(buffer: usize) -> (Sender<T>, Receiver<T>) {
	let queue = Rc::new(Queue {
		queue: ArrayQueue::new(buffer),
		waker: Default::default(),
	});
	(
		Sender {
			queue: queue.clone(),
		},
		Receiver { queue },
	)
}
pub fn channel < T > ( buffer : usize ) -> ( Sender < T > , Receiver < T > ) { let queue = Rc :: new ( Queue { queue : ArrayQueue :: new ( buffer ) , waker : Default :: default ( ) , } ) ; ( Sender { queue : queue . clone ( ) , } , Receiver { queue } , ) }
Creates a bounded mpsc channel for communicating between asynchronous tasks.
Creates a bounded mpsc channel for communicating between asynchronous tasks .
buffer
usize