A wazero host module, ABI and guest SDK providing byteinterval support for WASI modules.
First register the host module with the runtime
import (
"github.com/tetratelabs/wazero"
"github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1"
"github.com/pantopic/ext-range-watch/host-wazero"
)
func main() {
ctx := context.Background()
r := wazero.NewRuntimeWithConfig(ctx, wazero.NewRuntimeConfig())
wasi_snapshot_preview1.MustInstantiate(ctx, r)
module := wazero_range_watch.New()
module.Register(ctx, r)
// ...
}Then you can import the guest SDK into your WASI module to emit range watch events from WASI.
package main
import (
"github.com/pantopic/ext-range-watch/sdk-go"
)
func main() {}
//export test
func test() {
rangewatch.Emit(12345, [][]byte{
[]byte(`test-100`),
[]byte(`test-200`),
[]byte(`test-300`),
})
}This is useful for emitting watch events from WASM state machines.
This project is in alpha. Breaking API changes should be expected until Beta.
v0.0.x- Alpha- Stabilize API
v0.x.x- Beta- Finalize API
- Test in production
v1.x.x- General Availability- Proven long term stability in production