pub fn channel<A: Actor>(buffer: usize) -> (AddressSender<A>, AddressReceiver<A>) {
    // Check that the requested buffer size does not exceed the maximum buffer
    // size permitted by the system.
    assert!(buffer < MAX_BUFFER, "requested buffer size too large");

    let inner = Arc::new(Inner {
        buffer: AtomicUsize::new(buffer),
        state: AtomicUsize::new(INIT_STATE),
        message_queue: Queue::new(),
        parked_queue: Queue::new(),
        num_senders: AtomicUsize::new(1),
        recv_task: AtomicWaker::new(),
    });

    let tx = AddressSender {
        inner: Arc::clone(&inner),
        sender_task: Arc::new(Mutex::new(SenderTask::new())),
        maybe_parked: Arc::new(AtomicBool::new(false)),
    };

    let rx = AddressReceiver { inner };

    (tx, rx)
}
/// Creates an in-memory channel implementation of the `Stream` trait with
/// bounded capacity.
///
/// This method creates a concrete implementation of the `Stream` trait which
/// can be used to send values across threads in a streaming fashion. This
/// channel is unique in that it implements back pressure to ensure that the
/// sender never outpaces the receiver. The channel capacity is equal to
/// `buffer + num-senders`. In other words, each sender gets a guaranteed slot
/// in the channel capacity, and on top of that there are `buffer` "first come,
/// first serve" slots available to all senders.
///
/// The `Receiver` returned implements the `Stream` trait and has access to any
/// number of the associated combinators for transforming the result.
Creates an in-memory channel implementation of the `Stream` trait with
bounded capacity.

This method creates a concrete implementation of the `Stream` trait which
can be used to send values across threads in a streaming fashion. This
channel is unique in that it implements back pressure to ensure that the
sender never outpaces the receiver. The channel capacity is equal to
`buffer + num-senders`. In other words, each sender gets a guaranteed slot
in the channel capacity, and on top of that there are `buffer` "first come,
first serve" slots available to all senders.

The `Receiver` returned implements the `Stream` trait and has access to any
number of the associated combinators for transforming the result.
Creates an in - memory channel implementation of the ` Stream ` trait with bounded capacity . This method creates a concrete implementation of the ` Stream ` trait which can be used to send values across threads in a streaming fashion . This channel is unique in that it implements back pressure to ensure that the sender never outpaces the receiver . The channel capacity is equal to ` buffer + num - senders ` . In other words each sender gets a guaranteed slot in the channel capacity and on top of that there are ` buffer ` " first come first serve " slots available to all senders . The ` Receiver ` returned implements the ` Stream ` trait and has access to any number of the associated combinators for transforming the result .
pub fn channel<A: Actor>(buffer: usize) -> (AddressSender<A>, AddressReceiver<A>) {
    // Check that the requested buffer size does not exceed the maximum buffer
    // size permitted by the system.
    assert!(buffer < MAX_BUFFER, "requested buffer size too large");
    let inner = Arc::new(Inner {
        buffer: AtomicUsize::new(buffer),
        state: AtomicUsize::new(INIT_STATE),
        message_queue: Queue::new(),
        parked_queue: Queue::new(),
        num_senders: AtomicUsize::new(1),
        recv_task: AtomicWaker::new(),
    });
    let tx = AddressSender {
        inner: Arc::clone(&inner),
        sender_task: Arc::new(Mutex::new(SenderTask::new())),
        maybe_parked: Arc::new(AtomicBool::new(false)),
    };
    let rx = AddressReceiver { inner };
    (tx, rx)
}
pub fn channel < A : Actor > ( buffer : usize ) -> ( AddressSender < A > , AddressReceiver < A > ) { // Check that the requested buffer size does not exceed the maximum buffer // size permitted by the system. assert ! ( buffer MAX_BUFFER " " ) ; let inner = Arc :: new ( Inner { buffer : AtomicUsize :: new ( buffer ) , state : AtomicUsize :: new ( INIT_STATE ) , message_queue : Queue :: new ( ) , parked_queue : Queue :: new ( ) , num_senders : AtomicUsize :: new ( 1 ) , recv_task : AtomicWaker :: new ( ) , } ) ; let tx = AddressSender { inner : Arc :: clone ( & inner ) , sender_task : Arc :: new ( Mutex :: new ( SenderTask :: new ( ) ) ) , maybe_parked : Arc :: new ( AtomicBool :: new ( false ) ) , } ; let rx = AddressReceiver { inner } ; ( tx , rx ) }
Creates an in-memory channel implementation of the `Stream` trait with
bounded capacity.
Creates an in - memory channel implementation of the ` Stream ` trait with bounded capacity .
buffer
usize
buffer
usize