pub struct SchedulerConfig {
pub max_concurrent: usize,
pub queue_size: usize,
}Expand description
Scheduler configuration.
Tasks are executed through Pool, so submissions use the same bounded queue
and overflow semantics as PoolConfig. max_concurrent maps to the pool’s semaphore capacity
and queue_size maps to the internal submit queue capacity.
Values below one are clamped to one when the pool config is built.
Fields§
§max_concurrent: usizeMaximum concurrently executing tasks.
queue_size: usizeMaximum queued task submissions.
Implementations§
Source§impl SchedulerConfig
impl SchedulerConfig
Sourcepub fn to_pool_config(&self, name: impl Into<String>) -> PoolConfig
pub fn to_pool_config(&self, name: impl Into<String>) -> PoolConfig
Convert this scheduler config into the canonical worker pool config.
The resulting pool uses a bounded queue. With the default overflow policy,
submit waits for queue capacity instead of buffering indefinitely;
alternate policies can be configured on the returned PoolConfig before constructing a pool.
Trait Implementations§
Source§impl Clone for SchedulerConfig
impl Clone for SchedulerConfig
Source§fn clone(&self) -> SchedulerConfig
fn clone(&self) -> SchedulerConfig
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 SchedulerConfig
impl Debug for SchedulerConfig
Source§impl Default for SchedulerConfig
impl Default for SchedulerConfig
Source§impl<'de> Deserialize<'de> for SchedulerConfig
impl<'de> Deserialize<'de> for SchedulerConfig
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
impl Eq for SchedulerConfig
Source§impl PartialEq for SchedulerConfig
impl PartialEq for SchedulerConfig
Source§impl Serialize for SchedulerConfig
impl Serialize for SchedulerConfig
impl StructuralPartialEq for SchedulerConfig
Auto Trait Implementations§
impl Freeze for SchedulerConfig
impl RefUnwindSafe for SchedulerConfig
impl Send for SchedulerConfig
impl Sync for SchedulerConfig
impl Unpin for SchedulerConfig
impl UnsafeUnpin for SchedulerConfig
impl UnwindSafe for SchedulerConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.