pub struct BulkheadConfig {
pub max_concurrent: usize,
pub queue_depth: usize,
pub overflow_policy: OverflowPolicy,
}Expand description
Bounded parallelism configuration for a work class.
Fields§
§max_concurrent: usizeNumber of tasks allowed to execute concurrently.
queue_depth: usizeAdditional bounded admission slots (not unbounded queueing).
overflow_policy: OverflowPolicyOverflow behavior when capacity is exhausted.
Implementations§
Source§impl BulkheadConfig
impl BulkheadConfig
Sourcepub const fn new(
max_concurrent: usize,
queue_depth: usize,
overflow_policy: OverflowPolicy,
) -> Option<Self>
pub const fn new( max_concurrent: usize, queue_depth: usize, overflow_policy: OverflowPolicy, ) -> Option<Self>
Create an explicit configuration.
Returns None when max_concurrent is zero.
Sourcepub fn for_profile(profile: ParallelismProfile) -> Self
pub fn for_profile(profile: ParallelismProfile) -> Self
Conservative default derived from available CPU parallelism.
Uses the “balanced profile” formula from bd-22n.4:
clamp(P / 8, 1, 16) where P = available_parallelism.
Sourcepub const fn admission_limit(self) -> usize
pub const fn admission_limit(self) -> usize
Maximum admitted work units at once.
Trait Implementations§
Source§impl Clone for BulkheadConfig
impl Clone for BulkheadConfig
Source§fn clone(&self) -> BulkheadConfig
fn clone(&self) -> BulkheadConfig
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 BulkheadConfig
impl Debug for BulkheadConfig
Source§impl Default for BulkheadConfig
impl Default for BulkheadConfig
Source§impl PartialEq for BulkheadConfig
impl PartialEq for BulkheadConfig
impl Copy for BulkheadConfig
impl Eq for BulkheadConfig
impl StructuralPartialEq for BulkheadConfig
Auto Trait Implementations§
impl Freeze for BulkheadConfig
impl RefUnwindSafe for BulkheadConfig
impl Send for BulkheadConfig
impl Sync for BulkheadConfig
impl Unpin for BulkheadConfig
impl UnsafeUnpin for BulkheadConfig
impl UnwindSafe for BulkheadConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).