Namespace PatternKit.Behavioral.Command
Classes
- Command<TCtx>
Command Pattern (allocation-light)
Encapsulates a unit of work (an action) plus an optional inverse (undo) so it can be executed, queued, composed, retried, or reversed in a uniform way. This implementation focuses on very low allocation overhead while still supporting synchronous and asynchronous (ValueTask) execution and macro (composite) commands.
- Command<TCtx>.Builder
Fluent builder for Command<TCtx>. Not thread-safe; configure on one thread then call Build() once.
- Command<TCtx>.MacroBuilder
Builder for a macro command that runs sub-commands in order and undoes in reverse. Supports conditional inclusion via AddIf(bool, Command<TCtx>).
Delegates
- Command<TCtx>.Exec
Asynchronous (or synchronous) execution delegate signature. Return
default/ completed ValueTask for synchronous completion.