// Should be called once every 100ms to handle background tasks
Should be called once every 100ms to handle background tasks
Should be called once every 100ms to handle background tasks
pub fn background_tick(&self) {
        {
            let mut raft_node = self.raft_node.lock().unwrap();
            raft_node.tick();
            let leader_id = raft_node.raft.leader_id;
            if leader_id > 0 {
                self.leader_requests
                    .lock()
                    .unwrap()
                    .drain(..)
                    .for_each(|sender| sender.send(leader_id).unwrap());
            }
        }
        // TODO: should be able to only do this on ready, I think
        self.process_raft_queue();
    }
pub fn background_tick ( & self ) { { let mut raft_node = self . raft_node . lock ( ) . unwrap ( ) ; raft_node . tick ( ) ; let leader_id = raft_node . raft . leader_id ; if leader_id > 0 { self . leader_requests . lock ( ) . unwrap ( ) . drain ( .. ) . for_each ( | sender | sender . send ( leader_id ) . unwrap ( ) ) ; } } // TODO: should be able to only do this on ready, I think self . process_raft_queue ( ) ; }
Should be called once every 100ms to handle background tasks
Should be called once every 100ms to handle background tasks
&self