persistence

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package persistence contains optional interfaces for persistent actor mailboxes and actor state stores.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MailboxStore

type MailboxStore interface {
	Append(ctx context.Context, msg StoredEnvelope) error
	Dequeue(ctx context.Context, actorID actorlayer.ActorID, limit int) ([]StoredEnvelope, error)
	Ack(ctx context.Context, actorID actorlayer.ActorID, messageIDs []actorlayer.MessageID) error
	Nack(ctx context.Context, actorID actorlayer.ActorID, messageIDs []actorlayer.MessageID, retryAt time.Time) error
}

MailboxStore defines persistent mailbox operations for at-least-once delivery. MVP runtime can ignore this store; production implementations can wire it in later.

type StateStore

type StateStore interface {
	Load(ctx context.Context, actorID actorlayer.ActorID) (map[string]any, error)
	Save(ctx context.Context, actorID actorlayer.ActorID, state map[string]any) error
	Delete(ctx context.Context, actorID actorlayer.ActorID) error
}

StateStore defines persistent actor state operations keyed by ActorID.

type StoredEnvelope

type StoredEnvelope struct {
	ActorID     actorlayer.ActorID
	Envelope    actorlayer.Envelope
	Attempts    int
	VisibleAt   time.Time
	PersistedAt time.Time
}

StoredEnvelope is the persistence representation of one mailbox entry.

Jump to

Keyboard shortcuts

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