fn poll_messages(&mut self) -> Result<(), Error> {
        loop {
            if !self.close_requested && self.requests.is_empty() {
                match self.message_rx.recv() {
                    Ok(message) => self.handle_message(message)?,
                    _ => {
                        warn!("agent handle disconnected without close message");
                        self.close_requested = true;
                        break;
                    },
                }
            } else {
                match self.message_rx.try_recv() {
                    Ok(message) => self.handle_message(message)?,
                    Err(crossbeam_channel::TryRecvError::Empty) => break,
                    Err(crossbeam_channel::TryRecvError::Disconnected) => {
                        warn!("agent handle disconnected without close message");
                        self.close_requested = true;
                        break;
                    },
                }
            }
        }

        Ok(())
    }
/// Polls the message channel for new messages from any agent handles.
///
/// If there are no active requests right now, this function will block until a message is received.
Polls the message channel for new messages from any agent handles.
If there are no active requests right now, this function will block until a message is received.
Polls the message channel for new messages from any agent handles . If there are no active requests right now this function will block until a message is received .
fn poll_messages(&mut self) -> Result<(), Error> {
        loop {
            if !self.close_requested && self.requests.is_empty() {
                match self.message_rx.recv() {
                    Ok(message) => self.handle_message(message)?,
                    _ => {
                        warn!("agent handle disconnected without close message");
                        self.close_requested = true;
                        break;
                    },
                }
            } else {
                match self.message_rx.try_recv() {
                    Ok(message) => self.handle_message(message)?,
                    Err(crossbeam_channel::TryRecvError::Empty) => break,
                    Err(crossbeam_channel::TryRecvError::Disconnected) => {
                        warn!("agent handle disconnected without close message");
                        self.close_requested = true;
                        break;
                    },
                }
            }
        }
        Ok(())
    }
fn poll_messages ( & mut self ) -> Result < ( ) , Error > { loop { if ! self . close_requested && self . requests . is_empty ( ) { match self . message_rx . recv ( ) { Ok ( message ) => self . handle_message ( message ) ? , _ => { warn ! ( " " ) ; self . close_requested = true ; break ; } , } } else { match self . message_rx . try_recv ( ) { Ok ( message ) => self . handle_message ( message ) ? , Err ( crossbeam_channel :: TryRecvError :: Empty ) => break , Err ( crossbeam_channel :: TryRecvError :: Disconnected ) => { warn ! ( " " ) ; self . close_requested = true ; break ; } , } } } Ok ( ( ) ) }
Polls the message channel for new messages from any agent handles.
Polls the message channel for new messages from any agent handles .
&mut self
&mut self