One sandboxed BEAM instance running in Wasmtime.
The bundled native launcher embeds Wasmtime and owns the guest. This GenServer owns the launcher through an Erlang port for input and process lifecycle. Guest output arrives over a private local socket in records capped at 64 KiB. Delivery is re-armed after each record is processed, bounding raw bytes awaiting processing independently of owner event budgets.
The guest protocol uses length-prefixed frames (PROTOCOL.md in the repository):
- guest console output (
IO.puts/1etc.) arrives as:stdout/:stderrframes, :wasm.send/1in the guest arrives as a:messageframe (ETF),- the host delivers messages to guest processes with
:sendframes.
If the port dies (the guest crashed, ran out of memory, hit the wall-clock
limit, or was killed) every pending request fails with
{:error, {:vm_down, reason}} and this process stops. A guest frame longer
than :max_message_size (default 64 MiB) also stops the VM, with reason
{:vm_down, {:frame_too_large, length}}.
Use the public API in Kettlecorn.
Summary
Functions
Returns a specification to start this module under a supervisor.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.