fn try_recv(&mut self, stats: &ExecutorStats) -> bool {
        let mut should_terminate = false;
        match self.receiver.try_recv() {
            Ok(SchedCmd::Terminate(_)) => should_terminate = true,
            Ok(SchedCmd::RequestStats) => {
                if self.monitor.send(MonitorMessage::ExecutorStats(*stats)).is_err() {
                    log::debug!("failed to send to monitor");
                }
            },
            // rebuild if we're running
            Ok(SchedCmd::RebuildStealers) if self.get_state() == ExecutorState::Running => {
                self.stealers = self.build_stealers();
                log::debug!(
                    "executor {} rebuild stealers, running with {} stealers",
                    self.id,
                    self.stealers.len()
                );
            },
            // ignore rebuilds when not running
            Ok(SchedCmd::RebuildStealers) => (),
            Ok(_) => log::warn!("executor received unexpected message"),
            Err(crossbeam::channel::TryRecvError::Disconnected) => should_terminate = true,
            Err(_) => (),
        };
        should_terminate
    }
// check the channel, return true to quit.
check the channel, return true to quit.
check the channel return true to quit .
fn try_recv(&mut self, stats: &ExecutorStats) -> bool {
        let mut should_terminate = false;
        match self.receiver.try_recv() {
            Ok(SchedCmd::Terminate(_)) => should_terminate = true,
            Ok(SchedCmd::RequestStats) => {
                if self.monitor.send(MonitorMessage::ExecutorStats(*stats)).is_err() {
                    log::debug!("failed to send to monitor");
                }
            },
            // rebuild if we're running
            Ok(SchedCmd::RebuildStealers) if self.get_state() == ExecutorState::Running => {
                self.stealers = self.build_stealers();
                log::debug!(
                    "executor {} rebuild stealers, running with {} stealers",
                    self.id,
                    self.stealers.len()
                );
            },
            // ignore rebuilds when not running
            Ok(SchedCmd::RebuildStealers) => (),
            Ok(_) => log::warn!("executor received unexpected message"),
            Err(crossbeam::channel::TryRecvError::Disconnected) => should_terminate = true,
            Err(_) => (),
        };
        should_terminate
    }
fn try_recv ( & mut self , stats : & ExecutorStats ) -> bool { let mut should_terminate = false ; match self . receiver . try_recv ( ) { Ok ( SchedCmd :: Terminate ( _ ) ) => should_terminate = true , Ok ( SchedCmd :: RequestStats ) => { if self . monitor . send ( MonitorMessage :: ExecutorStats ( * stats ) ) . is_err ( ) { log :: debug ! ( " " ) ; } } , // rebuild if we're running Ok ( SchedCmd :: RebuildStealers ) if self . get_state ( ) == ExecutorState :: Running => { self . stealers = self . build_stealers ( ) ; log :: debug ! ( " " self id self stealers len ( ) ) ; } , // ignore rebuilds when not running Ok ( SchedCmd :: RebuildStealers ) => ( ) , Ok ( _ ) => log :: warn ! ( " " ) , Err ( crossbeam :: channel :: TryRecvError :: Disconnected ) => should_terminate = true , Err ( _ ) => ( ) , } ; should_terminate }
check the channel, return true to quit.
check the channel return true to quit .
&mut self
stats
&ExecutorStats