pub async fn create(max_concurrency: usize) -> Result<Self> {
        let limiter = Semaphore::new(max_concurrency);
        let thread_pool = rayon::ThreadPoolBuilder::new()
            .thread_name(|n| format!("executor-pool-worker-{}", n))
            .num_threads(max_concurrency)
            .build()?;

        Ok(Self {
            limiter,
            thread_pool,
        })
    }
/// Creates a new thread pool with a set concurrency.
///
/// The set concurrency determines the number of threads spawned.
Creates a new thread pool with a set concurrency.
The set concurrency determines the number of threads spawned.
Creates a new thread pool with a set concurrency . The set concurrency determines the number of threads spawned .
pub async fn create(max_concurrency: usize) -> Result<Self> {
        let limiter = Semaphore::new(max_concurrency);
        let thread_pool = rayon::ThreadPoolBuilder::new()
            .thread_name(|n| format!("executor-pool-worker-{}", n))
            .num_threads(max_concurrency)
            .build()?;
        Ok(Self {
            limiter,
            thread_pool,
        })
    }
pub async fn create ( max_concurrency : usize ) -> Result < Self > { let limiter = Semaphore :: new ( max_concurrency ) ; let thread_pool = rayon :: ThreadPoolBuilder :: new ( ) . thread_name ( | n | format ! ( " " n ) ) . num_threads ( max_concurrency ) . build ( ) ? ; Ok ( Self { limiter , thread_pool , } ) }
Creates a new thread pool with a set concurrency.
Creates a new thread pool with a set concurrency .
max_concurrency
usize
max_concurrency
usize