Expand description
The Controller trait — second-site extraction of the
reconcile-loop pattern. First site: engenho-scheduler::Scheduler.
A controller observes resources of a particular kind + (re) drives the world toward the declared spec. Pure I/O at the boundary; pure decision logic inside.
§The unified loop outcome
Pre-unification engenho carried TWO competing loop traits: the live
Controller (sweep-based, counter-only) and a dead generic
Reconciler<R> in engenho-types that owned a typed
requeue-bearing ReconcileResult but was never driven by anything.
Per the Prime Directive (two traits modelling one concept is the
duplication-bug), the dead trait is gone and its requeue vocabulary
lives HERE, folded into the live loop: tick now returns a
ReconcileOutcome carrying BOTH the ReconcileReport AND a
ReconcileResult. The default ReconcileResult::Done preserves
today’s behavior for every controller that doesn’t opt into a
requeue — the drivers act on the result only when it’s non-Done.
Structs§
- Controller
Type - A type that implements
Controller, named by the compiler (T5.11). - Reconcile
Outcome - Outcome of one reconcile tick — the report PLUS the requeue decision.
- Reconcile
Report - Outcome of one reconcile tick.
Enums§
- Reconcile
Result - One reconciliation attempt’s requeue decision.
Traits§
- Controller
- One controller — implements the standard reconcile-loop shape.