Function: applyEvent()
applyEvent(
ctx,runId,source,after?):Promise<TxOutcome>
Defined in: sdk/ts/sdk/src/host/transition.ts:81
Submits one event. Owns its transaction, recovers a reducer throw or a divergence into the matching marker, then runs the post-commit work (buffered signals, emits, kick).
A ReducerFailed is swallowed: the run is failed with an app_error marker and that outcome is returned. A Nondeterminism is recorded as a marker and then rethrown.
Parameters
ctx
runId
string
source
after?
Returns
Promise<TxOutcome>
Throws
RunNotFound when no run has that id.
Throws
RunTerminal when the run ended and the event is not a task result or a closing marker.
Throws
WorkflowRejected when the run's workflow is not registered on this host.
Throws
IllegalEvent when the kernel refuses the event for a reason other than a duplicate.
Throws
Nondeterminism after journaling the divergence.