diff --git a/go.mod b/go.mod index 82d9338..a75b6bd 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/wago-org/workers go 1.24.0 -require github.com/wago-org/wago v0.0.0-20260812144524-1c58c9862d25 +require github.com/wago-org/wago v0.1.0-beta.8.0.20260916050830-c9ed2455acd9 diff --git a/go.sum b/go.sum index 24b3655..f6a11d5 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -github.com/wago-org/wago v0.0.0-20260812144524-1c58c9862d25 h1:gopNHvaUaDSzmW2Hfd32r8dOwwzYUHH3ph1L/IuhJUA= -github.com/wago-org/wago v0.0.0-20260812144524-1c58c9862d25/go.mod h1:6XmxI3S5qJ+YAzObyXjC6FmxHtbLhBBxrglzix42zl8= +github.com/wago-org/wago v0.1.0-beta.8.0.20260916050830-c9ed2455acd9 h1:+/8b9bvAnyUZPG+YTvGpDwpAV+jpp6+bBBWOrr+8Xco= +github.com/wago-org/wago v0.1.0-beta.8.0.20260916050830-c9ed2455acd9/go.mod h1:q0pPiPF6W6GZpTXbWwy+GT+r19KHSzB/gRcPUVHyntI= diff --git a/workers_test.go b/workers_test.go index c8a70d7..53f6088 100644 --- a/workers_test.go +++ b/workers_test.go @@ -11,7 +11,7 @@ import ( "github.com/wago-org/wago" wagoplugin "github.com/wago-org/wago/plugin" - "github.com/wago-org/wago/tests/wasmtest" + "github.com/wago-org/wago/tests/support/wasmtest" ) type registerFunc func(*wago.Registrar) error @@ -91,17 +91,13 @@ func integrationProvider(p *integrationPlugin) wago.PluginProvider { if err != nil { return err } - module, err := imports.Module("test") - if err != nil { - return err - } - module.Func("spawn", func(caller wago.HostModule, _, _ []uint64) { + imports.HostFunc("test", "spawn", func(caller wago.Caller, _ wago.HostCall) { _ = p.service.With(func(service Service) error { p.id, _ = service.Spawn(caller, 0, WorkerOptions{QueueCapacity: 1, MaxPayloadBytes: 16, MaxQueueBytes: 16}) return nil }) }) - module.Func("next", func(caller wago.HostModule, _, _ []uint64) { + imports.HostFunc("test", "next", func(caller wago.Caller, _ wago.HostCall) { _ = p.service.With(func(service Service) error { return service.DispatchNext(context.Background(), caller) }) }) return reg.Lifecycle(wago.PluginLifecycle{ @@ -210,7 +206,7 @@ func TestPluginContractSpawnsCopiesMessageAndStops(t *testing.T) { case <-time.After(2 * time.Second): t.Fatal("exit timeout") } - if err := rt.Close(); err != nil { + if err := rt.CloseContext(context.Background()); err != nil { t.Fatal(err) } if err := p.service.With(func(Service) error { return nil }); !errors.Is(err, wago.ErrPermissionDenied) {