Documentation
¶
Overview ¶
Package runmanager owns in-process pipeline execution for the server: it triggers runs (each engine.Run on its own goroutine + bus), tracks active runs so they can be cancelled, and fans their live events out to SSE subscribers. Persistence (store + event log) is wired in as sinks, so a server-triggered run is recorded exactly like a CLI run.
Index ¶
- type Manager
- func (m *Manager) Active(runID string) bool
- func (m *Manager) Cancel(runID string) bool
- func (m *Manager) SetRunFunc(fn RunFunc)
- func (m *Manager) Shutdown(ctx context.Context)
- func (m *Manager) Subscribe(runID string) (<-chan engine.Event, func(), bool)
- func (m *Manager) Trigger(spec engine.Spec) (string, error)
- type RunFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager triggers, tracks and cancels runs.
func (*Manager) Cancel ¶
Cancel cancels an active run. It returns false if the run is unknown or has already finished.
func (*Manager) SetRunFunc ¶
SetRunFunc overrides the executor (tests).
func (*Manager) Shutdown ¶
Shutdown cancels every active run (so the engine runs container cleanup and SSE streams unblock) and waits for them to clear, or until ctx expires. It is called on server shutdown.
func (*Manager) Subscribe ¶
Subscribe returns a live event channel and unsubscribe func for an active run, or ok=false if the run is not currently running (callers then replay from the event log instead).