fn run(&mut self) {
        let gossip = self.gossip.clone();
        let event_handler = self.event_handler.clone();
        let log = self.log.clone();
        let killed = Arc::clone(&self.killed);
        let handle = self.rt_handle.spawn_blocking(move || {
            debug!(log, "P2P::p2p_timer(): started processing",);

            let timer_duration = Duration::from_millis(P2P_TIMER_DURATION_MS);
            while !killed.load(SeqCst) {
                std::thread::sleep(timer_duration);
                gossip.on_timer(Arc::clone(&event_handler));
            }
        });
        self.task_handles.push(handle);
    }
/// The method starts the P2P timer task in the background.
The method starts the P2P timer task in the background.
The method starts the P2P timer task in the background .
fn run(&mut self) {
        let gossip = self.gossip.clone();
        let event_handler = self.event_handler.clone();
        let log = self.log.clone();
        let killed = Arc::clone(&self.killed);
        let handle = self.rt_handle.spawn_blocking(move || {
            debug!(log, "P2P::p2p_timer(): started processing",);
            let timer_duration = Duration::from_millis(P2P_TIMER_DURATION_MS);
            while !killed.load(SeqCst) {
                std::thread::sleep(timer_duration);
                gossip.on_timer(Arc::clone(&event_handler));
            }
        });
        self.task_handles.push(handle);
    }
fn run ( & mut self ) { let gossip = self . gossip . clone ( ) ; let event_handler = self . event_handler . clone ( ) ; let log = self . log . clone ( ) ; let killed = Arc :: clone ( & self . killed ) ; let handle = self . rt_handle . spawn_blocking ( move | | { debug ! ( log " " ) ; let timer_duration = Duration :: from_millis ( P2P_TIMER_DURATION_MS ) ; while ! killed . load ( SeqCst ) { std :: thread :: sleep ( timer_duration ) ; gossip . on_timer ( Arc :: clone ( & event_handler ) ) ; } } ) ; self . task_handles . push ( handle ) ; }
The method starts the P2P timer task in the background.
The method starts the P2P timer task in the background .
&mut self
&mut self