refactor: helper methods for pool and max threads

This commit is contained in:
nnethercott 2025-05-14 23:45:24 +02:00
parent 806e983aa5
commit 865f24cfef
4 changed files with 30 additions and 27 deletions

View file

@ -54,6 +54,10 @@ impl ThreadPoolNoAbortBuilder {
ThreadPoolNoAbortBuilder::default()
}
pub fn new_for_indexing() -> ThreadPoolNoAbortBuilder {
ThreadPoolNoAbortBuilder::default().thread_name(|index| format!("indexing-thread:{index}"))
}
pub fn thread_name<F>(mut self, closure: F) -> Self
where
F: FnMut(usize) -> String + 'static,