CancelMode

Determines how a Bus should interpret cancellation when dispatching events that implement Cancelable.

A cancel mode is supplied to Bus.post to control whether event cancellation:

  • is ignored entirely,

  • is respected on a per-handler basis, or

  • should terminate dispatch immediately.

The mode applies only to event-handler invocation; exception-handler dispatch is unaffected.

Summary of Modes

ModeHandler Runs When Event Is Canceled?Stops Pipeline?
IGNOREYes, all handlers always runNever
RESPECTOnly handlers that explicitly opt-in to receiving canceled eventsNever
ENFORCENo; dispatch halts immediately on first cancellationYes

This design allows the caller to choose between:

  • simple "fire every handler" behavior,

  • fine-grained handler-level control over canceled events, and

  • strict short-circuit semantics in which cancellation acts as a hard stop.

Constructors

Link copied to clipboard
private constructor()

Entries

Link copied to clipboard

Cancellation is completely ignored.

Link copied to clipboard

Cancellation is respected on a per-handler basis, but does not stop the event-dispatch pipeline.

Link copied to clipboard

Cancellation is enforced as a hard stop.

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.