Skip to content

Commit 25df6f9

Browse files
Module refactor
1 parent 914ce82 commit 25df6f9

8 files changed

Lines changed: 296 additions & 192 deletions

File tree

pkg/workflows/wasm/host/internal/rawsdk/consts.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,3 @@ const (
44
ConsensusResponseMapKeyMetadata = "metadata"
55
ConsensusResponseMapKeyPayload = "payload"
66
)
7-
8-
const (
9-
// SuspendExecutionSignal is the sentinel the host writes to the response
10-
// buffer of an await call when an awaited capability has no response yet and
11-
// the execution must be suspended. It must match the host's errSuspendExecution.
12-
SuspendExecutionSignal = "__SUSPEND_EXECUTION__"
13-
// SuspendExecutionExitCode is the exit code the guest uses to signal the host
14-
// that it suspended on an await. It must match wasm.CodeSuspendExecution.
15-
SuspendExecutionExitCode = 114
16-
)

pkg/workflows/wasm/host/internal/rawsdk/helpers_wasip1.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,6 @@ func await[I, O proto.Message](input I, output O, fn awaitFn) {
199199

200200
if bytes < 0 {
201201
response = response[:-bytes]
202-
// The host signals suspension by writing the suspend sentinel to the
203-
// response buffer (returned as a negative length). When we see it we exit
204-
// with the suspend exit code so the host can wait for the pending
205-
// responses and resume the execution by re-running the guest.
206-
if string(response) == SuspendExecutionSignal {
207-
os.Exit(SuspendExecutionExitCode)
208-
}
209202
SendError(fmt.Errorf("awaitCapabilities returned an error %s", string(response)))
210203
}
211204

0 commit comments

Comments
 (0)