experimental: cleanup context keys (#2175)

Signed-off-by: Nuno Cruces <ncruces@users.noreply.github.com>
This commit is contained in:
Nuno Cruces
2024-04-06 13:04:55 +01:00
committed by GitHub
parent 59faf80fcc
commit c6a907bb9d
25 changed files with 112 additions and 65 deletions

View File

@@ -7,7 +7,7 @@ import (
"github.com/tetratelabs/wazero/api"
experimentalapi "github.com/tetratelabs/wazero/experimental"
internalclose "github.com/tetratelabs/wazero/internal/close"
"github.com/tetratelabs/wazero/internal/ctxkey"
internalsock "github.com/tetratelabs/wazero/internal/sock"
internalsys "github.com/tetratelabs/wazero/internal/sys"
"github.com/tetratelabs/wazero/internal/wasm"
@@ -242,7 +242,7 @@ func (r *runtime) CompileModule(ctx context.Context, binary []byte) (CompiledMod
func buildFunctionListeners(ctx context.Context, internal *wasm.Module) ([]experimentalapi.FunctionListener, error) {
// Test to see if internal code are using an experimental feature.
fnlf := ctx.Value(experimentalapi.FunctionListenerFactoryKey{})
fnlf := ctx.Value(ctxkey.FunctionListenerFactoryKey{})
if fnlf == nil {
return nil, nil
}
@@ -318,7 +318,7 @@ func (r *runtime) InstantiateModule(
return
}
if closeNotifier, ok := ctx.Value(internalclose.NotifierKey{}).(internalclose.Notifier); ok {
if closeNotifier, ok := ctx.Value(ctxkey.CloseNotifierKey{}).(ctxkey.Notifier); ok {
mod.(*wasm.ModuleInstance).CloseNotifier = closeNotifier
}