/// randomly pick a node and ask them for updates asynchronously
randomly pick a node and ask them for updates asynchronously
randomly pick a node and ask them for updates asynchronously
pub fn gossip(obj: Arc<RwLock<Self>>, exit: Arc<AtomicBool>) -> JoinHandle<()> {
        spawn(move || loop {
            let _ = Self::run_gossip(&obj);
            if exit.load(Ordering::Relaxed) {
                return;
            }
            //TODO this should be a tuned parameter
            sleep(obj.read().unwrap().timeout);
        })
    }
pub fn gossip ( obj : Arc < RwLock < Self > > , exit : Arc < AtomicBool > ) -> JoinHandle < ( ) > { spawn ( move | | loop { let _ = Self :: run_gossip ( & obj ) ; if exit . load ( Ordering :: Relaxed ) { return ; } //TODO this should be a tuned parameter sleep ( obj . read ( ) . unwrap ( ) . timeout ) ; } ) }
randomly pick a node and ask them for updates asynchronously
randomly pick a node and ask them for updates asynchronously
obj
Arc<RwLock<Self>>
exit
Arc<AtomicBool>