Learn
Execution lifecycle
Follow a command through admission, scheduling, processing, publication, and finalization.
Execution lifecycle
1. Admission
add validates the command registration, resolves input instructions, and decides whether intent may enter the lifecycle. Debounce, throttle, rate limit, and input conflict policy operate here. Rejected intent never becomes processing work and is reported through a typed rejection reason.
2. Scheduling
An accepted entry receives identity and enters the pending path. The runtime resolves its processing instructions and compares it with existing work in the same execution group.
3. Processing
The registered handler receives the typed command and an execution context. The context exposes its snapshot, publication, cancellation request, and error-aware execution boundary.
4. Publication
context.publish does not mutate state in place. It submits a value through the publication queue, preserving ordering and preventing reentrant listeners from corrupting lifecycle coordination.
5. Finalization
Every accepted command reaches a terminal outcome: success, failure, cancellation, rejection by a processing policy, or termination caused by close. Finalization records history and releases processing resources.
Close
The owner calls and awaits close. Close stops new admission, resolves queued and active work according to the close contract, completes observable resources, and cannot be treated as an incidental garbage-collection event.