schedule

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package schedule provides explicit correlation lifecycle helpers for scheduled work. Independent invocations start independent workflows unless application-owned metadata is deliberately propagated. New composes Create, Enqueue and Receive over an explicit Factory/queue codec. It owns no scheduler, job execution, acknowledgment, retry or background work; metadata and generator synchronization remain with their callers.

Deprecated: use github.com/faustbrian/go-correlation/adapters/schedule. This package remains supported through the documented compatibility interval.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidOptions = errors.New("schedule correlation: invalid options")

ErrInvalidOptions reports missing scheduled-work dependencies.

Functions

This section is empty.

Types

type Adapter

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

Adapter starts independent identity roots and propagates scheduled metadata, without starting jobs. Use New; it inherits Factory/queue ownership rules.

func New

func New(factory *correlation.Factory, options Options) (*Adapter, error)

New constructs a scheduled-work adapter retaining factory. Nil factory is ErrInvalidOptions; queue codec errors are preserved. Nothing is scheduled.

func (*Adapter) Create added in v1.1.0

func (adapter *Adapter) Create() (correlation.Values, error)

Create begins an independent scheduler invocation with no implicit derived or stable workflow identity.

func (*Adapter) Enqueue

func (adapter *Adapter) Enqueue(metadata map[string]string, parent correlation.Values) (correlation.Values, error)

Enqueue creates child scheduled-work metadata in the supplied nonnil map, refusing populated selected fields. It performs no enqueue/persistence; errors return zero Values and may consume generation state before injection fails.

func (*Adapter) Receive added in v1.1.0

func (adapter *Adapter) Receive(metadata map[string]string, trusted bool) (correlation.Values, error)

Receive receives scheduler metadata as a fresh attempt. Trust must be decided outside the adapter; nil metadata means absence. It delegates queue receipt validation/causation semantics and neither mutates the map nor executes a job.

func (*Adapter) Run deprecated

func (adapter *Adapter) Run(metadata map[string]string, trusted bool) (correlation.Values, error)

Run receives explicitly trusted scheduler metadata as a fresh attempt.

Deprecated: use Receive.

func (*Adapter) Start deprecated

func (adapter *Adapter) Start() (correlation.Values, error)

Start begins an independent scheduler invocation with no implicit derived or stable workflow identity.

Deprecated: use Create.

type Options

type Options struct {
	// Queue configures metadata names/validation used by Enqueue and Receive;
	// Create uses only the supplied Factory.
	Queue queuecorrelation.Options
}

Options configure optional scheduled metadata propagation.

Jump to

Keyboard shortcuts

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