cancel

fun cancel()

Client-initiated cancellation (notifications/cancelled). Completes the future now, not next tick, with whatever the eval had printed, tagged (cancelled) and marked isError. Idempotent; a no-op if the eval already finished.

Two mechanisms stop the eval, and kill uses the same pair:

  • dead = true — observed at the next pumpStep entry. Enough for the heartbeat lanes and for a cross-tick iterator between elements.

  • worker?.interrupt() — an off-tick ParallelLane worker can be blocked inside a single long step (I/O, sleep, park) whose pumpStep boundary never arrives; interrupt unblocks it. Null for the heartbeat lanes, whose tick thread must never be interrupted. dead is set before the interrupt, so the woken worker sees a dead task and unwinds. Not a hard kill: a step that swallows the interrupt or spins without ever blocking can't be stopped — the JVM offers no safe forcible stop.