pub fn cancel_channel(&self, key: &K) -> Result<(), ()> {
        let mut map_l = lock_c!(self.channels);
        //TODO: handle missing queue
        if let Some(channel) = map_l.get_mut(key) {
            // if we're not able to send a cancel command then probably
            // no work is running and/or a stop command was already send
            let _ = channel.cancel_bus.try_broadcast(());
            loop {
                match channel.recv.consume() {
                    Ok(_) => (), // more messages
                    _ => return Ok(()),
                }
            }
        } else {
            Err(())
        }
    }
/// Clear queue for specific channel & cancel workers
Clear queue for specific channel & cancel workers
Clear queue for specific channel & cancel workers
pub fn cancel_channel(&self, key: &K) -> Result<(), ()> {
        let mut map_l = lock_c!(self.channels);
        //TODO: handle missing queue
        if let Some(channel) = map_l.get_mut(key) {
            // if we're not able to send a cancel command then probably
            // no work is running and/or a stop command was already send
            let _ = channel.cancel_bus.try_broadcast(());
            loop {
                match channel.recv.consume() {
                    Ok(_) => (), // more messages
                    _ => return Ok(()),
                }
            }
        } else {
            Err(())
        }
    }
pub fn cancel_channel ( & self , key : & K ) -> Result < ( ) , ( ) > { let mut map_l = lock_c ! ( self channels ) ; //TODO: handle missing queue if let Some ( channel ) = map_l . get_mut ( key ) { // if we're not able to send a cancel command then probably // no work is running and/or a stop command was already send let _ = channel . cancel_bus . try_broadcast ( ( ) ) ; loop { match channel . recv . consume ( ) { Ok ( _ ) => ( ) , // more messages _ => return Ok ( ( ) ) , } } } else { Err ( ( ) ) } }
Clear queue for specific channel & cancel workers
Clear queue for specific channel & cancel workers
&self
key
&K
&self
key
&K