class Rooibos::Command::Cancel

Cancels a running command.

Long-running commands (WebSocket listeners, database pollers) run until stopped. Stopping them requires signaling from outside the command. The runtime tracks active commands by their object identity and routes cancel requests.

This type carries the handle (command object) to cancel. The runtime pattern-matches on Command::Cancel and signals the token.

Prefer the Command.cancel factory method for convenience.

Example

# Using the factory method (recommended)
[model, Command.cancel(model.active_fetch)]

# Using the class directly
[model, Cancel.new(handle: model.active_fetch)]