Files
wazero/examples/namespace
Crypt Keeper fe56fabd63 Removes invalid ignore files (#734)
None of the examples suggest `go build` first anymore.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2022-08-04 19:57:03 +12:00
..

Stateful import example

This example shows how WebAssembly modules can import their own stateful host module, such as "env", in the same runtime.

$ go run counter.go
ns1 count=0
ns2 count=0
ns1 count=1
ns2 count=1

Specifically, each WebAssembly-defined module is instantiated alongside its own Go-defined "env" module in a separate wazero.Namespace. This is more efficient than separate runtimes as instantiation re-uses the same compilation cache.