Skip to content

Commit

Permalink
add shared search executor (#2312)
Browse files Browse the repository at this point in the history
  • Loading branch information
MochiXu committed Feb 5, 2024
1 parent 1223a87 commit 88a3275
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/index/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,12 @@ impl Index {
Ok(())
}

/// Custom thread pool by a outer thread pool.
pub fn set_shared_multithread_executor(&mut self, shared_thread_pool: Arc<Executor>) -> crate::Result<()> {
self.executor = shared_thread_pool.clone();
Ok(())
}

/// Replace the default single thread search executor pool
/// by a thread pool with as many threads as there are CPUs on the system.
pub fn set_default_multithread_executor(&mut self) -> crate::Result<()> {
Expand Down

0 comments on commit 88a3275

Please sign in to comment.