Versions in this module Expand all Collapse all v0 v0.0.2 Aug 15, 2026 Changes in this version + const ComponentName + const ComponentStage + var ErrJobMissing = errors.New("cf_valkey_jobs: job payload is gone") + var ErrJobNotDead = errors.New("cf_valkey_jobs: job is not in the dead-letter set") + type CFValkeyJobs struct + func New(opts ...Option) *CFValkeyJobs + func (c *CFValkeyJobs) Client() valkey.Client + func (c *CFValkeyJobs) Enqueue(ctx context.Context, jobType string, payload []byte, opts ...EnqueueOption) (string, error) + func (c *CFValkeyJobs) GetDependencies() []string + func (c *CFValkeyJobs) GetInitOrderStage() cf.Stage + func (c *CFValkeyJobs) Health(ctx context.Context) error + func (c *CFValkeyJobs) Init(ctx context.Context, fw *cf.CaerusFramework) error + func (c *CFValkeyJobs) ListDead(ctx context.Context, offset, limit int64) ([]Job, error) + func (c *CFValkeyJobs) Metrics() []cf_observability.Metric + func (c *CFValkeyJobs) Name() string + func (c *CFValkeyJobs) OnConfigReload(source string, cfg any) + func (c *CFValkeyJobs) PurgeDead(ctx context.Context, id string) error + func (c *CFValkeyJobs) PurgeDeadAll(ctx context.Context) (int64, error) + func (c *CFValkeyJobs) RegisterConfigSources(conf any) error + func (c *CFValkeyJobs) Replay(ctx context.Context, id string) error + func (c *CFValkeyJobs) Run(ctx context.Context) error + func (c *CFValkeyJobs) Shutdown(ctx context.Context) error + type EnqueueOption func(*enqueueOptions) + func WithDelay(d time.Duration) EnqueueOption + func WithMaxAttempts(n int64) EnqueueOption + func WithRetention(d time.Duration) EnqueueOption + func WithRunAt(t time.Time) EnqueueOption + func WithVisibility(d time.Duration) EnqueueOption + type Job struct + Attempts int64 + CreatedAt time.Time + DeadAt time.Time + ID string + MaxAttempts int64 + Payload []byte + Type string + type JobHandler func(ctx context.Context, job Job) error + type JobsConfig struct + BatchSize int64 + Concurrency int64 + PollIntervalMs int64 + RetryFixedDelayMs int64 + RetryFixedPhaseMs int64 + RetryJitter *float64 + RetryMaxDelayMs int64 + WorkerEnabled *bool + type Option func(*options) + func WithBatchSize(n int64) Option + func WithConcurrency(n int64) Option + func WithConfig(cfg JobsConfig) Option + func WithConfigSource(name, path string, opts ...SourceOption) Option + func WithJobHandler(jobType string, fn JobHandler) Option + func WithLogger(logger *slog.Logger) Option + func WithName(name string) Option + func WithPollInterval(d time.Duration) Option + func WithRetryPolicy(fixedDelay, fixedPhase, maxDelay time.Duration) Option + func WithShutdownDrainTimeout(d time.Duration) Option + func WithValkeyName(name string) Option + func WithWorkerEnabled(on bool) Option + type SourceOption func(*sourceOptions) + func WithSourceEnvPrefix(prefix string) SourceOption + func WithSourceFormat(f cf_configuration.Format) SourceOption