Documentation
¶
Overview ¶
package: sequencer / coordination type: adapter job: a steerable clock for --dev — real time until told otherwise limits: time source only; who may steer it is core's access decision (-> core)
package: sequencer / coordination type: factory job: the Sequencer port — build the backend a config names, over the bookmark list it advances limits: wiring only; the head, the merges and the bookmarks are ranke-go's (-> ranke-go)
𝒰_hist is the Universe's own (Universe.Bookmarks), so there is no store to configure — only which list, as a seed or as the id of one entry.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sequencer ¶
Sequencer is the sequencer port's product: ranke-go's Sequencer contract — immutable snapshots to read from, and merges that advance the head to write.
func New ¶
func New(ctx context.Context, cfg scope.Section, storage ranke.Universe, sig signer.Signer, now func() time.Time) (Sequencer, error)
New builds the backend named by the section's "type". now is the time source claims are dated from; nil defaults to the wall clock, so a caller wanting a steerable one (--dev) supplies it instead.
The archive is opened, never founded: an empty bookmark list comes back reporting InGenesis, leaving Found the composition root's call (-> config).
type SteerableClock ¶
type SteerableClock struct {
// contains filtered or unexported fields
}
SteerableClock is a time source a caller can push forward — real time until the first Advance, then standing where it was put until told to move again. A story that wants its own dates steers to them; they run ahead of bt₀, which minted at boot from this same clock, so every later branch table still chains forward (R-C6MERGE, V-MONO).
func NewSteerableClock ¶
func NewSteerableClock() *SteerableClock
NewSteerableClock returns a clock reading real time until Advance is first called.
func (*SteerableClock) Advance ¶
func (c *SteerableClock) Advance(t time.Time) time.Time
Advance moves the clock to at least t, returning its position afterward. t compares against the clock's own last position — zero before the first call, which is why that first call always lands exactly on t, whatever real time says. A t at or behind the current position is a no-op that just reports where the clock already is.
func (*SteerableClock) Now ¶
func (c *SteerableClock) Now() time.Time
Now is this clock's now func() time.Time source for sequencer.New.