SyncCommand
open class SyncCommand : Command
Base class for synchronous commands that preserves typed throws.
Subclass this and override execute(payload:) throws(CommandError) for commands
that complete their work synchronously (e.g. setting a user property, logging an event).
The protocol requirement is handled by a final wrapper — subclasses cannot
accidentally override the wrong overload.
-
Declaration
Swift
public let name: String -
Undocumented
Declaration
Swift
public init(name: String) -
Protocol requirement — delegates to the synchronous overload. Do not override.
Declaration
Swift
public final func execute(payload: DataObject, completion: @escaping (CommandError?) -> Void) -> any Disposable -
Override this for synchronous command logic.
Throws
CommandErrorif validation fails or required parameters are missing.Declaration
Swift
open func execute(payload: DataObject) throws(CommandError)
View on GitHub