/// receives messages from `queue`, serializes them, and writes them to `stream`
receives messages from `queue`, serializes them, and writes them to `stream`
receives messages from ` queue ` serializes them and writes them to ` stream `
async fn send_loop<T>(
    mut stream: WriteHalf<T>,
    mut send_loop_receiver: mpsc::UnboundedReceiver<MessageReturnError>,
) where
    T: AsyncWrite,
{
    loop {
        let (message, tx) = match send_loop_receiver.recv().await {
            Some(x) => x,
            None => break,
        };
        if let Err(_) = tx.send(send_loop_inner(&mut stream, message).await) {
            // nothing can be done here
            return;
        }
    }
}
async fn send_loop < T > ( mut stream : WriteHalf < T > , mut send_loop_receiver : mpsc :: UnboundedReceiver < MessageReturnError > , ) where T : AsyncWrite , { loop { let ( message , tx ) = match send_loop_receiver . recv ( ) . await { Some ( x ) => x , None => break , } ; if let Err ( _ ) = tx . send ( send_loop_inner ( & mut stream , message ) . await ) { // nothing can be done here return ; } } }
receives messages from `queue`, serializes them, and writes them to `stream`
receives messages from ` queue ` serializes them and writes them to ` stream `
stream
WriteHalf<T>
send_loop_receiver
mpsc::UnboundedReceiver<MessageReturnError>