queue

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package queue dispatches schedule occurrences through queue.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidQueue = errors.New("scheduler queue: queue is required")

ErrInvalidQueue reports a missing queue backend.

Functions

This section is empty.

Types

type Dispatcher

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

Dispatcher encodes schedule occurrences and submits them to queue.

func New

func New(queue Enqueuer) (*Dispatcher, error)

New constructs a queue-backed scheduler executor.

func (*Dispatcher) Execute

func (dispatcher *Dispatcher) Execute(ctx context.Context, scheduled scheduler.Context) error

Execute encodes and submits one occurrence with trace propagation.

type Enqueuer

type Enqueuer interface {
	Queue(queuecore.QueuedMessage, ...queuejob.AllowOption) error
}

Enqueuer is the minimal durable queue submission contract.

type Envelope

type Envelope struct {
	ScheduleID     string            `json:"schedule_id"`
	CoordinationID string            `json:"coordination_id"`
	ScheduleName   string            `json:"schedule_name"`
	Task           string            `json:"task"`
	Occurrence     time.Time         `json:"occurrence"`
	Attempt        int               `json:"attempt"`
	IdempotencyKey string            `json:"idempotency_key"`
	Owner          string            `json:"owner"`
	FencingToken   uint64            `json:"fencing_token"`
	Parameters     map[string]any    `json:"parameters,omitempty"`
	Metadata       map[string]string `json:"metadata,omitempty"`
	TraceContext   map[string]string `json:"trace_context,omitempty"`
}

Envelope is the version-independent occurrence payload sent to workers.

Jump to

Keyboard shortcuts

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