pub fn with_shutdown<F, T>(&self, f: F) -> T
  where
    F: FnOnce() -> T,
  {
    let mut pool = self.pool.write();
    *pool = None;
    let t = f();
    *pool = Some(Self::new_pool(self.name_prefix.clone()));
    t
  }
///
/// Run a function while the pool is shut down, and restore the pool after it completes.
///
Run a function while the pool is shut down, and restore the pool after it completes.
Run a function while the pool is shut down and restore the pool after it completes .
pub fn with_shutdown<F, T>(&self, f: F) -> T
  where
    F: FnOnce() -> T,
  {
    let mut pool = self.pool.write();
    *pool = None;
    let t = f();
    *pool = Some(Self::new_pool(self.name_prefix.clone()));
    t
  }
pub fn with_shutdown < F , T > ( & self , f : F ) -> T where F : FnOnce ( ) -> T , { let mut pool = self . pool . write ( ) ; * pool = None ; let t = f ( ) ; * pool = Some ( Self :: new_pool ( self . name_prefix . clone ( ) ) ) ; t }
Run a function while the pool is shut down, and restore the pool after it completes.
Run a function while the pool is shut down and restore the pool after it completes .
&self
f
F