Fief.Planner.Elector (Fief v0.1.0)

Copy Markdown View Source

Two duties, one always-on process per instance:

Planner lifecycle. Receives the Leadership adapter's notifications and starts Fief.Planner in the slot on {:fief_leadership, :elected, term}, terminates it on :deposed. The planner never migrates state through this process — a new leader's planner derives everything from Authority reads.

The settle relay (design §6.3 rule 7, phase A's Fief.Instance.settle_relay_name/1 registration). Local donor agents send {:fief_settle_report, session, node} here; the Elector forwards each to the current leader's planner through Fief.Seam (addressed to Fief.Seam.planner_name/1 at the leader node — a scripted, droppable delivery under simulation, exactly like any peer message), and retains it until the row is observed settled, re-forwarding on a seam-timer cadence and on local election. Retention is what makes settle survive leader failover and lost relay messages: the donor's report is idempotent (the planner verifies the session against the current row before every settle CAS), so re-announcing is always safe. A report is dropped once the cached row's epoch moves past the session (settled or superseded) or after @max_report_tries re-sends.

Forwarding always goes through Transport — even leader-to-self — so every settle input to the planner is one uniform, steppable delivery.

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)