interactionledger

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package interactionledger owns adapter-neutral interaction authority state. It allocates opaque references and stores no native request, handle, reply callback, or reference-to-adapter lookup.

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
}

Ledger allocates an interaction reference and registration sequence for one Session. Its reference prefix is only presentation; the ledger never resolves a reference back to adapter state.

func New

func New(prefix string) *Ledger

New creates a Session-scoped interaction ledger.

func (*Ledger) Allocate

func (l *Ledger) Allocate() (agent.InteractionRef, uint64, error)

Allocate returns an opaque reference and the next registration sequence.

type Result

type Result struct {
	Outcome agent.InteractionOutcome
	Reason  string
}

Result is settlement data that remains independent of a native request.

type Slot

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

Slot serializes answer authority for one interaction. The zero value is pending and ready to use.

func (*Slot) Claim

func (s *Slot) Claim() bool

Claim admits one answer. It succeeds only while the interaction is pending.

func (*Slot) CompleteSent

func (s *Slot) CompleteSent(outcome agent.InteractionOutcome) bool

CompleteSent records a successfully submitted answer and its adapter-neutral outcome.

func (*Slot) CompleteTerminal

func (s *Slot) CompleteTerminal(
	outcome agent.InteractionOutcome,
	reason string,
) bool

CompleteTerminal consumes authority after an unknown or terminal native outcome. A terminal result takes precedence over a recorded sent result.

func (*Slot) ReleaseNotSent

func (s *Slot) ReleaseNotSent() bool

ReleaseNotSent reopens authority after a definite local non-delivery.

func (*Slot) Resolve

func (s *Slot) Resolve(fallback Result, answeredReason string) Result

Resolve waits for an admitted answer without requiring or retaining an adapter lock. It applies terminal, sent, then fallback precedence and caches the stable closure result.

func (*Slot) State

func (s *Slot) State() State

State returns the current authority phase.

type State

type State uint8

State is the adapter-neutral authority phase of one interaction.

const (
	Pending State = iota
	Answering
	Sent
	Settled
)

Jump to

Keyboard shortcuts

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