Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Fiber cancellation via Cancel and OnCancelled

Platform spec ADR

Fiber cancellation via Cancel and OnCancelled

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

Fibers need cooperative cancellation without panics on join or parked channel ops.

RuleDetail
SignalFiber.Cancel() sets runtime cancellation flag
EventEach `Fiber<T>` declares event OnCancelled(); runtime raises on child before unblocking parked ops
JoinJoin`Result<T, FiberError::Cancelled>` after cancellation observed
ChannelsParked Send / ReceiveChannelError::Cancelled
OrderingOnCancelled runs before Join / channel errors; handlers must not block on Join of self

Unhandled panic in OnCancelled aborts process in v1 (same as other unhandled event paths).

Corelib + runtime concurrency tests; cancel/join fixtures.