heldCancellation property

  1. @override
Cancelled? get heldCancellation
override

The cancellation an open uncancellable section of this job is holding back, or null.

A snapshot: a cancellation asked after the read is held all the same, and one read here may still never land — a section the body did not await outlives a job that ends first. So a step that made something worth keeping, a receipt of a payment that went through, keeps it inside the section whatever this says.

A cancellation the job cannot refuse is not held: it marks the job at once, and the one held until then is dropped, so this goes back to null while job's isCancelled turns true. A job created with cancellable: false refuses a cancellation rather than holding it, and this stays null. One value for the whole job, not for one section: code of the job outside a section, a branch next to it or unattended work, sees what another section holds. null once the job is over. Never throws.

See Holding the cancellation back on the cancellation page.

Implementation

@override
Cancelled? get heldCancellation => _owner.heldCancel;