fn post_pending_read_index_on_replica<T, C>(&mut self, ctx: &mut PollContext<EK, ER, T, C>) {
        while let Some(mut read) = self.pending_reads.pop_front() {
            assert!(read.read_index.is_some());
            let is_read_index_request = read.cmds.len() == 1
                && read.cmds[0].0.get_requests().len() == 1
                && read.cmds[0].0.get_requests()[0].get_cmd_type() == CmdType::ReadIndex;

            if is_read_index_request {
                self.response_read(&mut read, ctx, false);
            } else if self.ready_to_handle_unsafe_replica_read(read.read_index.unwrap()) {
                self.response_read(&mut read, ctx, true);
            } else {
                // TODO: `ReadIndex` requests could be blocked.
                self.pending_reads.push_front(read);
                break;
            }
        }
    }
/// Responses to the ready read index request on the replica, the replica is not a leader.
Responses to the ready read index request on the replica, the replica is not a leader.
Responses to the ready read index request on the replica the replica is not a leader .
fn post_pending_read_index_on_replica<T, C>(&mut self, ctx: &mut PollContext<EK, ER, T, C>) {
        while let Some(mut read) = self.pending_reads.pop_front() {
            assert!(read.read_index.is_some());
            let is_read_index_request = read.cmds.len() == 1
                && read.cmds[0].0.get_requests().len() == 1
                && read.cmds[0].0.get_requests()[0].get_cmd_type() == CmdType::ReadIndex;
            if is_read_index_request {
                self.response_read(&mut read, ctx, false);
            } else if self.ready_to_handle_unsafe_replica_read(read.read_index.unwrap()) {
                self.response_read(&mut read, ctx, true);
            } else {
                // TODO: `ReadIndex` requests could be blocked.
                self.pending_reads.push_front(read);
                break;
            }
        }
    }
fn post_pending_read_index_on_replica < T , C > ( & mut self , ctx : & mut PollContext < EK , ER , T , C > ) { while let Some ( mut read ) = self . pending_reads . pop_front ( ) { assert ! ( read read_index is_some ( ) ) ; let is_read_index_request = read . cmds . len ( ) == 1 && read . cmds [ 0 ] . 0 . get_requests ( ) . len ( ) == 1 && read . cmds [ 0 ] . 0 . get_requests ( ) [ 0 ] . get_cmd_type ( ) == CmdType :: ReadIndex ; if is_read_index_request { self . response_read ( & mut read , ctx , false ) ; } else if self . ready_to_handle_unsafe_replica_read ( read . read_index . unwrap ( ) ) { self . response_read ( & mut read , ctx , true ) ; } else { // TODO: `ReadIndex` requests could be blocked. self . pending_reads . push_front ( read ) ; break ; } } }
Responses to the ready read index request on the replica, the replica is not a leader.
Responses to the ready read index request on the replica the replica is not a leader .
&mut self
ctx
&mut PollContext<EK, ER, T, C>