Documentation
¶
Overview ¶
Package executor is the boundary between an accepting runner and its sessions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor interface {
// Start starts a session for the offer and returns once the session runs
// or fails to start. The session reports progress and its outcome through
// report until it ends; report is safe to call from any goroutine.
Start(ctx context.Context, offer runnerapi.Offer, report func(runnerapi.SessionReport)) error
// Cancel stops the task's session. The session's final report is
// Canceled once the executor observed it stopped.
Cancel(ctx context.Context, task string) error
}
Executor runs agent sessions on one runner. The runner calls it after it accepted an offer; it never talks to Beekeeper itself.
type Resumer ¶
type Resumer interface {
// Pending lists recorded tasks that may still owe the coordinator an outcome.
Pending() ([]string, error)
// Resume reattaches to the recorded task after the coordinator confirms
// ownership. Its context and report callback have the same lifetime as Start's.
Resume(ctx context.Context, task string, report func(runnerapi.SessionReport)) error
}
Resumer is implemented by executors whose sessions survive a runner restart.