scheduler

package
v0.60.8 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobTypeContentPublish   = "cms.content.publish"
	JobTypeContentUnpublish = "cms.content.unpublish"
	JobTypePagePublish      = "cms.page.publish"
	JobTypePageUnpublish    = "cms.page.unpublish"
)

Variables

This section is empty.

Functions

func ContentPublishJobKey

func ContentPublishJobKey(id uuid.UUID) string

func ContentUnpublishJobKey

func ContentUnpublishJobKey(id uuid.UUID) string

func NewInMemory

func NewInMemory(opts ...Option) interfaces.Scheduler

NewInMemory creates a deterministic scheduler implementation suitable for tests.

func NewNoOp

func NewNoOp() interfaces.Scheduler

NewNoOp returns a scheduler implementation that drops every request.

func PagePublishJobKey

func PagePublishJobKey(id uuid.UUID) string

func PageUnpublishJobKey

func PageUnpublishJobKey(id uuid.UUID) string

Types

type Option

type Option func(*inMemoryScheduler)

Option allows customizing the behaviour of the in-memory scheduler.

func WithClock

func WithClock(clock func() time.Time) Option

WithClock overrides the internal clock, used mainly for tests.

func WithDefaultMaxAttempts

func WithDefaultMaxAttempts(limit int) Option

WithDefaultMaxAttempts overrides the default retry attempts applied when the job spec leaves it unset.

func WithIDGenerator

func WithIDGenerator(generator func() string) Option

WithIDGenerator overrides the ID generator used when enqueuing jobs.

Jump to

Keyboard shortcuts

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