fn run(&mut self) {
        let mut index = 0;
        loop {
            if let Some(ref mut ratelimit) = self.ratelimit {
                ratelimit.wait();
            }
            let t0 = self.clocksource.counter();
            let mut msg = Some(self.protocol.generate_message());
            loop {
                match self.queue[index].push(msg.take().unwrap()) {
                    Ok(_) => {
                        let t1 = self.clocksource.counter();
                        let _ = self.stats.send(Sample::new(t0, t1, Stat::RequestPrepared));
                        break;
                    }
                    Err(m) => {
                        msg = Some(m);
                    }
                }
                index += 1;
                if index >= self.queue.len() {
                    index = 0;
                    break;
                }
            }
        }
    }
/// Generates work at a fixed rate and pushes to the queue
Generates work at a fixed rate and pushes to the queue
Generates work at a fixed rate and pushes to the queue
fn run(&mut self) {
        let mut index = 0;
        loop {
            if let Some(ref mut ratelimit) = self.ratelimit {
                ratelimit.wait();
            }
            let t0 = self.clocksource.counter();
            let mut msg = Some(self.protocol.generate_message());
            loop {
                match self.queue[index].push(msg.take().unwrap()) {
                    Ok(_) => {
                        let t1 = self.clocksource.counter();
                        let _ = self.stats.send(Sample::new(t0, t1, Stat::RequestPrepared));
                        break;
                    }
                    Err(m) => {
                        msg = Some(m);
                    }
                }
                index += 1;
                if index >= self.queue.len() {
                    index = 0;
                    break;
                }
            }
        }
    }
fn run ( & mut self ) { let mut index = 0 ; loop { if let Some ( ref mut ratelimit ) = self . ratelimit { ratelimit . wait ( ) ; } let t0 = self . clocksource . counter ( ) ; let mut msg = Some ( self . protocol . generate_message ( ) ) ; loop { match self . queue [ index ] . push ( msg . take ( ) . unwrap ( ) ) { Ok ( _ ) => { let t1 = self . clocksource . counter ( ) ; let _ = self . stats . send ( Sample :: new ( t0 , t1 , Stat :: RequestPrepared ) ) ; break ; } Err ( m ) => { msg = Some ( m ) ; } } index += 1 ; if index >= self . queue . len ( ) { index = 0 ; break ; } } } }
Generates work at a fixed rate and pushes to the queue
Generates work at a fixed rate and pushes to the queue
&mut self
&mut self