/// Balancer test helper that runs client I/O on a task.
Balancer test helper that runs client I/O on a task.
Balancer test helper that runs client I / O on a task .
fn spawn_io() -> (
        io::DuplexStream,
        tokio::task::JoinHandle<io::Result<String>>,
    ) {
        let (mut client_io, server_io) = io::duplex(100);
        let task = tokio::spawn(async move {
            client_io.write_all(b"who r u?").await?;
            let mut buf = String::with_capacity(100);
            client_io.read_to_string(&mut buf).await?;
            Ok(buf)
        });
        (server_io, task)
    }
fn spawn_io ( ) -> ( io :: DuplexStream , tokio :: task :: JoinHandle < io :: Result < String > > , ) { let ( mut client_io , server_io ) = io :: duplex ( 100 ) ; let task = tokio :: spawn ( async move { client_io . write_all ( b" " ) . await ? ; let mut buf = String :: with_capacity ( 100 ) ; client_io . read_to_string ( & mut buf ) . await ? ; Ok ( buf ) } ) ; ( server_io , task ) }
Balancer test helper that runs client I/O on a task.
Balancer test helper that runs client I / O on a task .