async fn poll_control(&self) -> Result<(), RuntimeMethodError> {
        let mut data = self.data.lock().await;
        match data.crx.try_recv() {
            Ok(m) => match m {
                ControlMessage::Abort => {
                    data.aborted = true;
                    return Err(RuntimeMethodError::EffectAborted);
                }
            },
            Err(err) => {
                match err {
                    tokio::sync::mpsc::error::TryRecvError::Empty => {
                        // No control messages pending
                    }
                    tokio::sync::mpsc::error::TryRecvError::Disconnected => {
                        // We were disconnected
                        data.aborted = true;
                        return Err(RuntimeMethodError::EffectAborted);
                    }
                }
            }
        }

        if self.completed(&*data) {
            Err(RuntimeMethodError::EffectAborted)
        } else {
            Ok(())
        }
    }
/// Returns true if the should abort
Returns true if the should abort
Returns true if the should abort
async fn poll_control(&self) -> Result<(), RuntimeMethodError> {
        let mut data = self.data.lock().await;
        match data.crx.try_recv() {
            Ok(m) => match m {
                ControlMessage::Abort => {
                    data.aborted = true;
                    return Err(RuntimeMethodError::EffectAborted);
                }
            },
            Err(err) => {
                match err {
                    tokio::sync::mpsc::error::TryRecvError::Empty => {
                        // No control messages pending
                    }
                    tokio::sync::mpsc::error::TryRecvError::Disconnected => {
                        // We were disconnected
                        data.aborted = true;
                        return Err(RuntimeMethodError::EffectAborted);
                    }
                }
            }
        }
        if self.completed(&*data) {
            Err(RuntimeMethodError::EffectAborted)
        } else {
            Ok(())
        }
    }
async fn poll_control ( & self ) -> Result < ( ) , RuntimeMethodError > { let mut data = self . data . lock ( ) . await ; match data . crx . try_recv ( ) { Ok ( m ) => match m { ControlMessage :: Abort => { data . aborted = true ; return Err ( RuntimeMethodError :: EffectAborted ) ; } } , Err ( err ) => { match err { tokio :: sync :: mpsc :: error :: TryRecvError :: Empty => { // No control messages pending } tokio :: sync :: mpsc :: error :: TryRecvError :: Disconnected => { // We were disconnected data . aborted = true ; return Err ( RuntimeMethodError :: EffectAborted ) ; } } } } if self . completed ( & * data ) { Err ( RuntimeMethodError :: EffectAborted ) } else { Ok ( ( ) ) } }
Returns true if the should abort
Returns true if the should abort
&self
&self