memory

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package memory provides a process-local implementation of core.Store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store[T any] struct {
	// contains filtered or unexported fields
}

Store keeps delivery state in memory (doesn't survive process restarts).

func New

func New[T any]() *Store[T]

New returns an empty Store.

func (*Store[T]) ActivateDestination

func (s *Store[T]) ActivateDestination(ctx context.Context, plan core.PlanID, destination core.DestinationID) error

ActivateDestination lets the destination receive newly enqueued work again.

func (*Store[T]) Admit

func (s *Store[T]) Admit(ctx context.Context, plan core.Plan, items []core.Item[T]) error

Admit registers the plan and creates one delivery obligation per plan destination for each item.

func (*Store[T]) Claim

func (s *Store[T]) Claim(ctx context.Context, request core.ClaimRequest) ([]core.Work[T], error)

Claim implements core.Store.

func (*Store[T]) PendingPlans

func (s *Store[T]) PendingPlans(ctx context.Context) ([]core.PlanID, error)

PendingPlans returns every plan that still holds unfinished deliveries.

func (*Store[T]) QuarantineDestination

func (s *Store[T]) QuarantineDestination(
	ctx context.Context, plan core.PlanID, destination core.DestinationID, failure string,
) error

QuarantineDestination blocks the destination and terminalizes its work.

func (*Store[T]) Resolve

func (s *Store[T]) Resolve(ctx context.Context, resolution core.Resolution) error

Resolve implements core.Store.

Jump to

Keyboard shortcuts

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