Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shared search executor #2312

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add shared search executor
  • Loading branch information
MochiXu committed Feb 5, 2024
commit f56f09942d7014848beb4395cc4553b1d9c5a249
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
Loading