scheduler

package
v0.0.0-...-4afd048 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 12 Imported by: 0

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

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

func (s *Scheduler) CancelExecution(ctx context.Context, executionID core.ID, reason error) bool

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.

func (*Scheduler) Run

func (s *Scheduler) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL