pub struct AdvancedThreadPool { /* private fields */ }Expand description
Advanced thread pool with work stealing
Implementations§
Source§impl AdvancedThreadPool
impl AdvancedThreadPool
Sourcepub fn new(config: ThreadPoolConfig) -> Self
pub fn new(config: ThreadPoolConfig) -> Self
Create a new advanced thread pool
Sourcepub fn submit<F>(&self, task: F) -> Result<TaskHandle<()>, ThreadPoolError>
pub fn submit<F>(&self, task: F) -> Result<TaskHandle<()>, ThreadPoolError>
Submit a task to the thread pool
Sourcepub fn submit_batch<F, I>(
&self,
tasks: I,
) -> Result<Vec<TaskHandle<()>>, ThreadPoolError>
pub fn submit_batch<F, I>( &self, tasks: I, ) -> Result<Vec<TaskHandle<()>>, ThreadPoolError>
Submit a batch of tasks
Sourcepub fn get_stats(&self) -> AdvancedThreadPoolStats
pub fn get_stats(&self) -> AdvancedThreadPoolStats
Get thread pool statistics
Sourcepub fn shutdown(self) -> Result<(), ThreadPoolError>
pub fn shutdown(self) -> Result<(), ThreadPoolError>
Shutdown the thread pool
Auto Trait Implementations§
impl Freeze for AdvancedThreadPool
impl !RefUnwindSafe for AdvancedThreadPool
impl Send for AdvancedThreadPool
impl Sync for AdvancedThreadPool
impl Unpin for AdvancedThreadPool
impl UnsafeUnpin for AdvancedThreadPool
impl !UnwindSafe for AdvancedThreadPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more