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