namespace

command
v1.0.0-pre.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

README

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.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL