pub struct PoolConfig {
pub size: usize,
pub name_prefix: String,
pub mailbox_capacity: usize,
pub restart: RestartPolicy,
pub shutdown: ShutdownPolicy,
pub ask_timeout: Duration,
}Expand description
Configuration for a WorkerPool.
Pass to [EngineHandle::spawn_worker_pool] to create and supervise N
identical worker actors under the /user supervisor.
Fields§
§size: usizeNumber of worker actors to spawn. Must be ≥ 1.
name_prefix: StringPrefix used to derive per-worker actor names.
Workers are spawned with paths {parent}/{name_prefix}-0,
{parent}/{name_prefix}-1, … under whichever supervisor the pool
builder targets.
mailbox_capacity: usizePer-worker mailbox capacity. Default: 1024.
restart: RestartPolicyRestart policy applied to each worker. Default: RestartPolicy::Permanent.
shutdown: ShutdownPolicyShutdown policy applied to each worker. Default: 5-second graceful stop.
ask_timeout: DurationTimeout for ask() calls routed through this pool. Default: 30 seconds.
Trait Implementations§
Source§impl Clone for PoolConfig
impl Clone for PoolConfig
Source§fn clone(&self) -> PoolConfig
fn clone(&self) -> PoolConfig
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 PoolConfig
impl Debug for PoolConfig
Source§impl Default for PoolConfig
impl Default for PoolConfig
Source§fn default() -> PoolConfig
fn default() -> PoolConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PoolConfig
impl RefUnwindSafe for PoolConfig
impl Send for PoolConfig
impl Sync for PoolConfig
impl Unpin for PoolConfig
impl UnsafeUnpin for PoolConfig
impl UnwindSafe for PoolConfig
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