#[non_exhaustive]pub struct InstancePoolConfig {
pub warm_instances_per_tuple: usize,
pub max_total_warm: usize,
}Expand description
Pool configuration. One pool per executor.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.warm_instances_per_tuple: usizePre-spawn N instances per (tenant, module-hash) tuple. Default 0
= pool disabled (every acquire falls through to
TensorWasmExecutor::spawn_instance).
The pool’s channel capacity is max(warm_instances_per_tuple, 1)
— a rendezvous channel (capacity 0) would deadlock the release
path, so we floor the channel size at 1 even when pre-warming is
disabled. With a 0 setting the warm channel is empty at startup
and the first release populates it; this gives the second
acquire of the same tuple a warm draw at the cost of paying
cold-start on the first.
max_total_warm: usizeMaximum number of pre-spawned instances across all tuples. Pools
honour this cap before spawning a new tuple. Default 0 = unlimited
(within the executor’s max_instances).
Implementations§
Source§impl InstancePoolConfig
impl InstancePoolConfig
Sourcepub fn new(warm_instances_per_tuple: usize, max_total_warm: usize) -> Self
pub fn new(warm_instances_per_tuple: usize, max_total_warm: usize) -> Self
Construct a pool config. Kept available for foreign-crate callers
even though InstancePoolConfig is #[non_exhaustive].
Trait Implementations§
Source§impl Clone for InstancePoolConfig
impl Clone for InstancePoolConfig
Source§fn clone(&self) -> InstancePoolConfig
fn clone(&self) -> InstancePoolConfig
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 InstancePoolConfig
impl Debug for InstancePoolConfig
Source§impl Default for InstancePoolConfig
impl Default for InstancePoolConfig
Source§fn default() -> InstancePoolConfig
fn default() -> InstancePoolConfig
Auto Trait Implementations§
impl Freeze for InstancePoolConfig
impl RefUnwindSafe for InstancePoolConfig
impl Send for InstancePoolConfig
impl Sync for InstancePoolConfig
impl Unpin for InstancePoolConfig
impl UnsafeUnpin for InstancePoolConfig
impl UnwindSafe for InstancePoolConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more