Skip to main content

Module instance

Module instance 

Source
Expand description

Per-instance state used by TensorWasmExecutor.

Each running Wasm instance has a TensorWasmInstance which owns:

  • the wasmtime Store<InstanceState> driving execution,
  • the wasmtime Instance itself,
  • identity (TenantId, InstanceId),
  • per-instance deadlines and metadata used by metrics and tracing,
  • the per-instance TensorWasmResourceLimiter that caps linear-memory growth.

Instances are typically held inside an Arc<Mutex<TensorWasmInstance>> so the executor can drive their lifecycle from a Tokio task while the API layer invokes exported functions.

Structsยง

InstanceState
Side-channel data attached to each wasmtime Store.
TensorWasmInstance
A running Wasm instance.