pub async fn wait(&self) -> Result<(), CacheError> {
        if self.is_closed.load(Ordering::SeqCst) {
            return Ok(());
        }

        let wg = WaitGroup::new();
        let wait_item = Item::Wait(wg.add(1));
        match self.insert_buf_tx
            .try_send(wait_item) {
            Ok(_) => Ok(wg.wait().await),
            Err(e) => Err(CacheError::SendError(format!("cache set buf sender: {}", e.to_string()))),
        }
    }
/// wait until the previous operations finished.
wait until the previous operations finished.
wait until the previous operations finished .
pub async fn wait(&self) -> Result<(), CacheError> {
        if self.is_closed.load(Ordering::SeqCst) {
            return Ok(());
        }
        let wg = WaitGroup::new();
        let wait_item = Item::Wait(wg.add(1));
        match self.insert_buf_tx
            .try_send(wait_item) {
            Ok(_) => Ok(wg.wait().await),
            Err(e) => Err(CacheError::SendError(format!("cache set buf sender: {}", e.to_string()))),
        }
    }
pub async fn wait ( & self ) -> Result < ( ) , CacheError > { if self . is_closed . load ( Ordering :: SeqCst ) { return Ok ( ( ) ) ; } let wg = WaitGroup :: new ( ) ; let wait_item = Item :: Wait ( wg . add ( 1 ) ) ; match self . insert_buf_tx . try_send ( wait_item ) { Ok ( _ ) => Ok ( wg . wait ( ) . await ) , Err ( e ) => Err ( CacheError :: SendError ( format ! ( " " e to_string ( ) ) ) ) , } }
wait until the previous operations finished.
wait until the previous operations finished .
&self
&self