Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
12 changes: 4 additions & 8 deletions workers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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) {
Expand Down
Loading