sequencer

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 13 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 ranke-go sequencer backend named in a config section limits: wiring only; the head, merges and history are ranke-go's (-> ranke-go)

The single writer advances the head k → k′ and keeps past heads for rollback (paper 2 §Sequencer). That mechanism is ranke-go's; this package only picks a backend.

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 it mints claims from; nil defaults to the wall clock. Both dev.NewSequencer and concurrent.NewSequencer already accept any Clock — real time is this package's own choice, not something either backend requires — so a caller wanting a different source (a steerable one, for --dev) supplies now instead of leaving it nil.

type SteerableClock added in v1.15.0

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 added in v1.15.0

func NewSteerableClock() *SteerableClock

NewSteerableClock returns a clock reading the epoch until Advance is first called.

func (*SteerableClock) Advance added in v1.15.0

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 added in v1.15.0

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