async fn install_snapshot_deamon(&self) {
        loop {
            sleep(INSALL_SNAPSHPT_CHECK_PERIOD).await;
            let raft = self.inner.lock().unwrap();
            if !raft.state.is_leader() {
                continue;
            }
            let mut rpcs = raft.send_install_snapshot_rpc();
            drop(raft); // TODO: is this drop necessary ?
            let inner = Arc::clone(&self.inner);
            task::spawn(async move {
                while let Some(Ok(reply)) = rpcs.next().await {
                    let mut raft = inner.lock().unwrap();
                    if !raft.check_incoming_term(reply.term) {
                        break;
                    }
                }
            })
            .detach();
        }
    }
// Leader will send InstallSnapshot RPC to followers that lag behind
Leader will send InstallSnapshot RPC to followers that lag behind
Leader will send InstallSnapshot RPC to followers that lag behind
async fn install_snapshot_deamon(&self) {
        loop {
            sleep(INSALL_SNAPSHPT_CHECK_PERIOD).await;
            let raft = self.inner.lock().unwrap();
            if !raft.state.is_leader() {
                continue;
            }
            let mut rpcs = raft.send_install_snapshot_rpc();
            drop(raft); // TODO: is this drop necessary ?
            let inner = Arc::clone(&self.inner);
            task::spawn(async move {
                while let Some(Ok(reply)) = rpcs.next().await {
                    let mut raft = inner.lock().unwrap();
                    if !raft.check_incoming_term(reply.term) {
                        break;
                    }
                }
            })
            .detach();
        }
    }
async fn install_snapshot_deamon ( & self ) { loop { sleep ( INSALL_SNAPSHPT_CHECK_PERIOD ) . await ; let raft = self . inner . lock ( ) . unwrap ( ) ; if ! raft . state . is_leader ( ) { continue ; } let mut rpcs = raft . send_install_snapshot_rpc ( ) ; drop ( raft ) ; // TODO: is this drop necessary ? let inner = Arc :: clone ( & self . inner ) ; task :: spawn ( async move { while let Some ( Ok ( reply ) ) = rpcs . next ( ) . await { let mut raft = inner . lock ( ) . unwrap ( ) ; if ! raft . check_incoming_term ( reply . term ) { break ; } } } ) . detach ( ) ; } }
Leader will send InstallSnapshot RPC to followers that lag behind
Leader will send InstallSnapshot RPC to followers that lag behind
&self
&self