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.
Click to show internal directories.
Click to hide internal directories.