sequencer

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

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

type Sequencer = ranke.Sequencer

Sequencer is the sequencer port's product: ranke-go's Sequencer contract. The server reaches the archive through it — 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 — epoch-pinned until the first Advance, then pinned there until told to move again. Epoch, not real time, because bt₀ mints from this clock at boot, before any --dev caller can steer it, and every later branch table chains back to bt₀ (R-C6MERGE) — same reasoning as the sequencer's own identity in sequencer.go's contributor.

func NewSteerableClock

func NewSteerableClock() *SteerableClock

NewSteerableClock returns a clock reading the epoch 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.

Jump to

Keyboard shortcuts

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