pub struct WorkerPool { /* private fields */ }
Expand description
FFT Worker Pool Manager Simplified to use core parallel abstractions instead of direct ThreadPool management
Implementations§
Source§impl WorkerPool
impl WorkerPool
Sourcepub fn with_config(
config: WorkerConfig,
) -> Result<Self, Box<dyn Error + Send + Sync>>
pub fn with_config( config: WorkerConfig, ) -> Result<Self, Box<dyn Error + Send + Sync>>
Create a new worker pool with custom configuration
Sourcepub fn get_workers(&self) -> usize
pub fn get_workers(&self) -> usize
Get the current number of worker threads
Sourcepub fn set_workers(
&mut self,
num_workers: usize,
) -> Result<(), Box<dyn Error + Send + Sync>>
pub fn set_workers( &mut self, num_workers: usize, ) -> Result<(), Box<dyn Error + Send + Sync>>
Set the number of worker threads
Update configuration - actual thread management handled by core parallel abstractions
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if parallelization is enabled
Sourcepub fn set_enabled(&self, enabled: bool)
pub fn set_enabled(&self, enabled: bool)
Enable or disable parallelization
Sourcepub fn execute<F, R>(&self, f: F) -> R
pub fn execute<F, R>(&self, f: F) -> R
Execute a function in the worker pool if enabled Simplified to use core parallel abstractions
Sourcepub fn execute_with_workers<F, R>(&self, _numworkers: usize, f: F) -> R
pub fn execute_with_workers<F, R>(&self, _numworkers: usize, f: F) -> R
Execute a function with a specific number of workers Simplified to use core parallel abstractions
Sourcepub fn get_info(&self) -> WorkerPoolInfo
pub fn get_info(&self) -> WorkerPoolInfo
Get information about the worker pool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WorkerPool
impl RefUnwindSafe for WorkerPool
impl Send for WorkerPool
impl Sync for WorkerPool
impl Unpin for WorkerPool
impl UnwindSafe for WorkerPool
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