pub struct ParallelConfig {
pub max_workers: usize,
pub overflow_strategy: OverflowStrategy,
pub task_queue_size: usize,
pub enable_task_priorities: bool,
pub auto_balance_workers: bool,
}
Expand description
Parallel processing configuration.
Controls how parallel processing is performed, including worker management, task distribution, and overflow handling strategies.
§Examples
use subx_cli::config::{ParallelConfig, OverflowStrategy};
let parallel = ParallelConfig::default();
assert!(parallel.max_workers > 0);
assert_eq!(parallel.overflow_strategy, OverflowStrategy::Block);
Fields§
§max_workers: usize
Maximum number of worker threads.
overflow_strategy: OverflowStrategy
Strategy for handling task overflow when queues are full.
Determines the behavior when the task queue reaches capacity.
OverflowStrategy::Block
- Block until space is availableOverflowStrategy::Drop
- Drop new tasks when fullOverflowStrategy::Expand
- Dynamically expand queue size
task_queue_size: usize
Task queue size.
enable_task_priorities: bool
Enable task priorities.
auto_balance_workers: bool
Auto-balance workers.
Trait Implementations§
Source§impl Clone for ParallelConfig
impl Clone for ParallelConfig
Source§fn clone(&self) -> ParallelConfig
fn clone(&self) -> ParallelConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ParallelConfig
impl Debug for ParallelConfig
Source§impl Default for ParallelConfig
impl Default for ParallelConfig
Source§impl<'de> Deserialize<'de> for ParallelConfig
impl<'de> Deserialize<'de> for ParallelConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ParallelConfig
impl RefUnwindSafe for ParallelConfig
impl Send for ParallelConfig
impl Sync for ParallelConfig
impl Unpin for ParallelConfig
impl UnwindSafe for ParallelConfig
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