Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func New ¶
func New(bus contracts.EventBus, executions contracts.ExecutionRepository, scopes *executionmodel.ScopeRegistry) (*Scheduler, error)
New builds a scheduler that advances executions and owns their cancellable scopes. Ownership lives here because advancing an execution and ending it are the same responsibility: the scheduler binds a scope when an execution starts, releases it when the execution reaches a terminal state, and is what a cancellation request goes through.
func (*Scheduler) CancelExecution ¶
CancelExecution stops an execution at the operator's request.
The scope is cancelled before the state is recorded, so a capability already running is aborted as early as possible rather than after the bookkeeping. The execution is then made terminal, which is what actually stops the scheduler advancing it: onCapabilityCompleted and onCapabilityDetached both return early once an execution is terminal, so no further capability is scheduled and no new binding is evaluated.
It reports whether this call cancelled the execution. A false return means the execution was already terminal or unknown, and the caller must not claim it cancelled something that had already finished.