pub async fn observe(&self) -> Result<(), PoolError> {
        let mut completed: usize = 0;
        while let Ok(output) = self.control_receiver.recv().await {
            completed += 1;
            if output.is_err() {
                for tx in self.stop_senders.iter() {
                    if tx.send(()).await.is_err() {
                        eprintln!("Task already finished")
                    }
                }
                return output;
            }
            if completed == self.stop_senders.len() {
                break;
            }
        }
        Ok(())
    }
/// Ensure that all spawned tasks are canceled on individual task error or any ` stop()` request issued by the user.
/// Call this function once all tasks are spawned.
/// A task that fails before a call to `observe()` is being awaited will still trigger a stop as soon as you actually start awaiting here.
Ensure that all spawned tasks are canceled on individual task error or any ` stop()` request issued by the user.
Call this function once all tasks are spawned.
A task that fails before a call to `observe()` is being awaited will still trigger a stop as soon as you actually start awaiting here.
Ensure that all spawned tasks are canceled on individual task error or any ` stop () ` request issued by the user . Call this function once all tasks are spawned . A task that fails before a call to ` observe () ` is being awaited will still trigger a stop as soon as you actually start awaiting here .
pub async fn observe(&self) -> Result<(), PoolError> {
        let mut completed: usize = 0;
        while let Ok(output) = self.control_receiver.recv().await {
            completed += 1;
            if output.is_err() {
                for tx in self.stop_senders.iter() {
                    if tx.send(()).await.is_err() {
                        eprintln!("Task already finished")
                    }
                }
                return output;
            }
            if completed == self.stop_senders.len() {
                break;
            }
        }
        Ok(())
    }
pub async fn observe ( & self ) -> Result < ( ) , PoolError > { let mut completed : usize = 0 ; while let Ok ( output ) = self . control_receiver . recv ( ) . await { completed += 1 ; if output . is_err ( ) { for tx in self . stop_senders . iter ( ) { if tx . send ( ( ) ) . await . is_err ( ) { eprintln ! ( " " ) } } return output ; } if completed == self . stop_senders . len ( ) { break ; } } Ok ( ( ) ) }
Ensure that all spawned tasks are canceled on individual task error or any ` stop()` request issued by the user.
Ensure that all spawned tasks are canceled on individual task error or any ` stop () ` request issued by the user .
&self