pub struct LeanWorkerPoolConfig { /* private fields */ }Expand description
Configuration for a local LeanWorkerPool.
Implementations§
Source§impl LeanWorkerPoolConfig
impl LeanWorkerPoolConfig
Sourcepub fn new(max_workers: usize) -> Self
pub fn new(max_workers: usize) -> Self
Create pool configuration with a fixed local worker limit.
Sourcepub fn max_workers(&self) -> usize
pub fn max_workers(&self) -> usize
Return the maximum number of local child workers the pool may own.
Sourcepub fn max_total_child_rss_kib(self, limit: u64) -> Self
pub fn max_total_child_rss_kib(self, limit: u64) -> Self
Reject new distinct workers when known total child RSS reaches limit.
RSS sampling is best effort. On platforms where the pool cannot obtain samples, it records unavailable samples and does not make a false admission claim.
Sourcepub fn per_worker_rss_ceiling_kib(self, limit: u64) -> Self
pub fn per_worker_rss_ceiling_kib(self, limit: u64) -> Self
Cycle a worker before assigning work when its sampled RSS reaches limit.
Sourcepub fn idle_cycle_after(self, limit: Duration) -> Self
pub fn idle_cycle_after(self, limit: Duration) -> Self
Cycle an idle worker before assigning more work through an old lease.
Sourcepub fn queue_wait_timeout(self, timeout: Duration) -> Self
pub fn queue_wait_timeout(self, timeout: Duration) -> Self
Wait this long for local pool admission before returning a typed error.
The current pool is synchronous. This timeout documents and bounds the admission point without exposing worker ids or queue internals.
Sourcepub fn max_total_child_rss_kib_limit(&self) -> Option<u64>
pub fn max_total_child_rss_kib_limit(&self) -> Option<u64>
Return the configured total child RSS budget in KiB.
Sourcepub fn per_worker_rss_ceiling_kib_limit(&self) -> Option<u64>
pub fn per_worker_rss_ceiling_kib_limit(&self) -> Option<u64>
Return the configured per-worker RSS ceiling in KiB.
Sourcepub fn idle_cycle_after_limit(&self) -> Option<Duration>
pub fn idle_cycle_after_limit(&self) -> Option<Duration>
Return the configured idle-cycle duration.
Sourcepub fn queue_wait_timeout_limit(&self) -> Duration
pub fn queue_wait_timeout_limit(&self) -> Duration
Return the configured pool admission wait timeout.
Trait Implementations§
Source§impl Clone for LeanWorkerPoolConfig
impl Clone for LeanWorkerPoolConfig
Source§fn clone(&self) -> LeanWorkerPoolConfig
fn clone(&self) -> LeanWorkerPoolConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LeanWorkerPoolConfig
impl Debug for LeanWorkerPoolConfig
Source§impl Default for LeanWorkerPoolConfig
impl Default for LeanWorkerPoolConfig
Source§impl PartialEq for LeanWorkerPoolConfig
impl PartialEq for LeanWorkerPoolConfig
Source§fn eq(&self, other: &LeanWorkerPoolConfig) -> bool
fn eq(&self, other: &LeanWorkerPoolConfig) -> bool
self and other values to be equal, and is used by ==.