Command
public protocol Command
Protocol for remote commands executed via command pattern.
Registered in CommandRegistry with O(1) lookup by name.
-
Command name used for routing by
CommandRegistry. The registry normalizes names by trimming whitespace and lowercasing before lookup, so implementations should provide a logical, case-insensitive name without leading/trailing whitespace.Declaration
Swift
var name: String { get } -
Executes the command with the given payload.
Declaration
Swift
func execute(payload: DataObject, completion: @escaping (CommandError?) -> Void) -> any DisposableParameters
payloadThe data to process.
completionCalled exactly once with
nilon success or aCommandErroron failure.Return Value
A
Disposablethat cancels in-progress async work when disposed.
View on GitHub