pub async fn create(
        reader: tantivy::IndexReader,
        threads_per_reader: usize,
        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()?;

        let reader_executors =
            TantivyExecutorPool::create(max_concurrency, threads_per_reader).await?;

        Ok(Self {
            reader,
            reader_executors,
            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(
        reader: tantivy::IndexReader,
        threads_per_reader: usize,
        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()?;
        let reader_executors =
            TantivyExecutorPool::create(max_concurrency, threads_per_reader).await?;
        Ok(Self {
            reader,
            reader_executors,
            limiter,
            thread_pool,
        })
    }
pub async fn create ( reader : tantivy :: IndexReader , threads_per_reader : usize , 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 ( ) ? ; let reader_executors = TantivyExecutorPool :: create ( max_concurrency , threads_per_reader ) . await ? ; Ok ( Self { reader , reader_executors , limiter , thread_pool , } ) }
Creates a new thread pool with a set concurrency.
Creates a new thread pool with a set concurrency .
reader
tantivy::IndexReader
threads_per_reader
usize
max_concurrency
usize
reader
tantivy::IndexReader
threads_per_reader
usize
max_concurrency
usize