pub fn channel<T>(buffer: Option<usize>) -> (Sender<T>, Receiver<T>) {
    if let Some(buffer) = buffer {
        let (tx, rx) = mpsc::channel(buffer);
        (Sender::Bounded(tx), Receiver::Bounded(rx))
    } else {
        let (tx, rx) = mpsc::unbounded_channel();
        (Sender::Unbounded(tx), Receiver::Unbounded(rx))
    }
}
/// Create a Tokio [`mpsc`] sender/receiver pair that is either bounded or unbounded, depending on
/// whether a buffer size is specified.
Create a Tokio [`mpsc`] sender/receiver pair that is either bounded or unbounded, depending on
whether a buffer size is specified.
Create a Tokio [ ` mpsc ` ] sender / receiver pair that is either bounded or unbounded depending on whether a buffer size is specified .
pub fn channel<T>(buffer: Option<usize>) -> (Sender<T>, Receiver<T>) {
    if let Some(buffer) = buffer {
        let (tx, rx) = mpsc::channel(buffer);
        (Sender::Bounded(tx), Receiver::Bounded(rx))
    } else {
        let (tx, rx) = mpsc::unbounded_channel();
        (Sender::Unbounded(tx), Receiver::Unbounded(rx))
    }
}
pub fn channel < T > ( buffer : Option < usize > ) -> ( Sender < T > , Receiver < T > ) { if let Some ( buffer ) = buffer { let ( tx , rx ) = mpsc :: channel ( buffer ) ; ( Sender :: Bounded ( tx ) , Receiver :: Bounded ( rx ) ) } else { let ( tx , rx ) = mpsc :: unbounded_channel ( ) ; ( Sender :: Unbounded ( tx ) , Receiver :: Unbounded ( rx ) ) } }
Create a Tokio [`mpsc`] sender/receiver pair that is either bounded or unbounded, depending on
whether a buffer size is specified.
Create a Tokio [ ` mpsc ` ] sender / receiver pair that is either bounded or unbounded depending on whether a buffer size is specified .
buffer
Option<usize>