fn disable_instance(&mut self, pos: usize) {
        let host = self.instances_available.lock().unwrap().remove(pos);
        self.instances_disabled.lock().unwrap().push(host.clone());
        // schedule attempt to reenable
        let instances_disabled = self.instances_disabled.clone();
        let instances_available = self.instances_available.clone();
        let timeout = self.failover_timeout.lock().unwrap().clone();
        Thread::spawn(move || {
            io::timer::sleep(timeout);
            Cluster::remove_instance_by_attrs(instances_disabled, host.clone());
            instances_available.lock().unwrap().push(host);
        });
    }
/// Disable an instance, and schedule it for reenabling after failover_timeout
Disable an instance, and schedule it for reenabling after failover_timeout
Disable an instance and schedule it for reenabling after failover_timeout
fn disable_instance(&mut self, pos: usize) {
        let host = self.instances_available.lock().unwrap().remove(pos);
        self.instances_disabled.lock().unwrap().push(host.clone());
        // schedule attempt to reenable
        let instances_disabled = self.instances_disabled.clone();
        let instances_available = self.instances_available.clone();
        let timeout = self.failover_timeout.lock().unwrap().clone();
        Thread::spawn(move || {
            io::timer::sleep(timeout);
            Cluster::remove_instance_by_attrs(instances_disabled, host.clone());
            instances_available.lock().unwrap().push(host);
        });
    }
fn disable_instance ( & mut self , pos : usize ) { let host = self . instances_available . lock ( ) . unwrap ( ) . remove ( pos ) ; self . instances_disabled . lock ( ) . unwrap ( ) . push ( host . clone ( ) ) ; // schedule attempt to reenable let instances_disabled = self . instances_disabled . clone ( ) ; let instances_available = self . instances_available . clone ( ) ; let timeout = self . failover_timeout . lock ( ) . unwrap ( ) . clone ( ) ; Thread :: spawn ( move | | { io :: timer :: sleep ( timeout ) ; Cluster :: remove_instance_by_attrs ( instances_disabled , host . clone ( ) ) ; instances_available . lock ( ) . unwrap ( ) . push ( host ) ; } ) ; }
Disable an instance, and schedule it for reenabling after failover_timeout
Disable an instance and schedule it for reenabling after failover_timeout
&mut self
pos
usize
&mut self
pos
usize