bun

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ledger

type Ledger struct {
	// contains filtered or unexported fields
}

func New

func New(db *bun.DB) *Ledger

func (*Ledger) Claim

func (l *Ledger) Claim(ctx context.Context, unitID string, payload json.RawMessage) (func() error, bool, error)

func (*Ledger) CreateBlueprint

func (l *Ledger) CreateBlueprint(ctx context.Context, manifest ledger.BlueprintManifest) ([]ledger.Unit, error)

CreateBlueprint atomically persists the manifest, records unit_dispatched events for root task units, and returns those units for publication. Signal units are never auto-dispatched — they wait for SendSignal.

func (*Ledger) GatherDepResults

func (l *Ledger) GatherDepResults(ctx context.Context, unitID string) (map[string][]json.RawMessage, error)

func (*Ledger) GetUnit added in v0.9.2

func (l *Ledger) GetUnit(ctx context.Context, unitID string) (ledger.Unit, error)

func (*Ledger) RecordCompleted

func (l *Ledger) RecordCompleted(ctx context.Context, unitID string, result any) (bool, []ledger.Unit, error)

func (*Ledger) RecordFailed

func (l *Ledger) RecordFailed(ctx context.Context, unitID string, unitErr error) error

func (*Ledger) SendSignal

func (l *Ledger) SendSignal(ctx context.Context, blueprintID, signalKey string, payload any) ([]ledger.Unit, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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