control

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package control provides the adapters that plug Fort's deterministic components into the control-plane ports (ui.Dispatcher, ui.FlowRunner).

This is the composition seam for "control plane, optionally with execution":

  • EngineDispatcher / FlowExecutor wrap the real router + DAG engine (full mode).
  • QueueDispatcher boards tasks with no execution plane at all (control-only mode).

cmd/fort picks which adapters to wire; the ui module only ever sees the ports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EngineDispatcher

type EngineDispatcher struct {
	// contains filtered or unexported fields
}

EngineDispatcher routes + dispatches via the deterministic engine.

func NewEngineDispatcher

func NewEngineDispatcher(e *engine.Engine) EngineDispatcher

NewEngineDispatcher adapts an engine to ui.Dispatcher.

func (EngineDispatcher) Submit

func (d EngineDispatcher) Submit(ctx context.Context, t task.Task) (ui.RunRef, error)

Submit routes the task and starts native execution.

type FlowExecutor

type FlowExecutor struct {
	// contains filtered or unexported fields
}

FlowExecutor adapts the DAG executor to ui.FlowRunner (id-based).

func NewFlowExecutor

func NewFlowExecutor(x *graph.Executor, flows []graph.Flow) FlowExecutor

NewFlowExecutor adapts a graph executor + flow set to ui.FlowRunner.

func (FlowExecutor) Approve

func (f FlowExecutor) Approve(runID, nodeID, edit string) error

Approve records a gate approval.

func (FlowExecutor) Reject

func (f FlowExecutor) Reject(runID, nodeID string) error

Reject records a gate rejection.

func (FlowExecutor) ResumeFlow

func (f FlowExecutor) ResumeFlow(ctx context.Context, flowID, runID string) (ui.RunResult, error)

ResumeFlow resumes the named flow.

func (FlowExecutor) StartFlow

func (f FlowExecutor) StartFlow(ctx context.Context, flowID, runID, payload string) (ui.RunResult, error)

StartFlow starts the named flow.

type QueueDispatcher

type QueueDispatcher struct {
	// contains filtered or unexported fields
}

QueueDispatcher boards a task as a "queued" run with no execution plane.

func NewQueueDispatcher

func NewQueueDispatcher(s *store.Store) QueueDispatcher

NewQueueDispatcher adapts a store to ui.Dispatcher for control-only mode.

func (QueueDispatcher) Submit

func (d QueueDispatcher) Submit(_ context.Context, t task.Task) (ui.RunRef, error)

Submit records the task on the board as queued; it is never dispatched.

type Roster

type Roster struct {
	// contains filtered or unexported fields
}

Roster adapts a machine registry to ui.MachineLister and tracks peer reachability by polling each machine's /health (spec 022). The local machine is reachable by definition; peers start unreachable until first probed.

func NewRoster

func NewRoster(reg *machines.Registry) *Roster

NewRoster builds a roster over reg.

func (*Roster) Machines

func (r *Roster) Machines() []ui.MachineStatus

Machines implements ui.MachineLister.

func (*Roster) Poll

func (r *Roster) Poll(ctx context.Context, interval time.Duration)

Poll refreshes peer reachability every interval until ctx is done. Run it in a goroutine from the composition root.

Jump to

Keyboard shortcuts

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