RunCancellableEvents

fun EventSchemaBuilderScope.RunCancellableEvents(id: String = randomId(), trigger: EventTrigger, cancellableEventId: String, events: EventSchemaBuilderScope.() -> Unit = {})

Runs its own child events inline, in order, inside a cancellable job registered under cancellableEventId — a later CancelEvents carrying the same id stops the job mid-flight. Unlike most events, events here is the payload executed rather than a downstream chain, and it receives this event's incomingData. The job runs in its own coroutine scope, so this event returns as soon as the job is registered, without waiting for events to finish. Dispatches onSuccess (no data) as soon as the job is registered — not when it finishes; onFailure when events is empty, since there is nothing to run.

Parameters

id

Unique identifier of this event. Defaults to a random id.

trigger

Trigger that fires this event, built via EventTriggers.

cancellableEventId

Id this cancellable job is registered under, matched by a later CancelEvents.

events

Events run inline as the cancellable job's payload, receiving this event's incomingData.