pub struct ParallelRuntime { /* private fields */ }Expand description
Selects where parallel traversal jobs execute.
The default uses the process-wide Weavatrix pool. Dedicated pools are joined on last drop. External executors receive the configured busy timeout and may reject submission without leaving a traversal waiting for a worker.
Implementations§
Source§impl ParallelRuntime
impl ParallelRuntime
Sourcepub fn dedicated(parallelism: usize) -> Result<Self>
pub fn dedicated(parallelism: usize) -> Result<Self>
Creates an owned pool with exactly parallelism.max(1) workers.
§Errors
Returns an operating-system thread creation error.
Sourcepub fn external(executor: Arc<dyn ParallelExecutor>) -> Self
pub fn external(executor: Arc<dyn ParallelExecutor>) -> Self
Uses an application-owned executor.
Sourcepub fn with_busy_timeout(self, busy_timeout: Option<Duration>) -> Self
pub fn with_busy_timeout(self, busy_timeout: Option<Duration>) -> Self
Supplies the maximum wait an external executor may use to accept work.
Sourcepub fn parallelism(&self) -> usize
pub fn parallelism(&self) -> usize
Maximum useful worker count advertised by this runtime.
Trait Implementations§
Source§impl Clone for ParallelRuntime
impl Clone for ParallelRuntime
Source§fn clone(&self) -> ParallelRuntime
fn clone(&self) -> ParallelRuntime
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ParallelRuntime
impl Debug for ParallelRuntime
Auto Trait Implementations§
impl !RefUnwindSafe for ParallelRuntime
impl !UnwindSafe for ParallelRuntime
impl Freeze for ParallelRuntime
impl Send for ParallelRuntime
impl Sync for ParallelRuntime
impl Unpin for ParallelRuntime
impl UnsafeUnpin for ParallelRuntime
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