Expand description
Generic pre-warmed instance pool for wasm-backed plugins.
One pool per loaded plugin. Holds a fixed-size queue of warm
instances; acquire is a wait-free pop in steady state. Cold
first-call latency (10–100 ms wasmtime instantiation) amortizes to
pool-size O(1) cost once the pool is primed.
Per the M6.shared lift, the pool is generic over both:
T— the pooled instance type (extism::Plugin,wasmtime::component::Instance, or a dummy in tests).E— the loader-specific error type. The factory returnsResult<T, E>;acquireconstructsEfrom a resource-exhaustion message viaPoolResourceLimit.
Each loader supplies a one-line impl PoolResourceLimit for ItsError
so the pool can raise its capacity errors without knowing the loader’s
error shape.
Structs§
- Instance
Pool - A pool of pre-warmed instances for one plugin.
- Pool
Config - Per-pool configuration.
- Pool
Metrics - Pool metrics surface — read by
host.metric_counterhost imports. - Pooled
Instance - RAII wrapper acquired from an
InstancePool: holds the instance and returns it to the pool on drop.
Traits§
- Pool
Resource Limit - Loader-error trait used by
InstancePool::acquireto construct the “pool at capacity” error.