redis

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricsQueueSuffix    = ":metrics"
	MetricsAckQueueSuffix = ":metrics:ack"
	JobIndexKeyFormat     = "job_index:%s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisStore

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

func NewRedisStore

func NewRedisStore(client *redis.Client, config config.Config, redisManager *manager.RedisClientManager, addr string, db int, logger logger.Logger) *RedisStore

func (*RedisStore) Ack

func (rs *RedisStore) Ack(queueName string, jobID string) error

func (*RedisStore) DequeueMetrics

func (rs *RedisStore) DequeueMetrics(queueName string) (config.JobMetrics, error)

func (*RedisStore) EnqueueMetrics

func (r *RedisStore) EnqueueMetrics(metrics config.JobMetrics) error

func (*RedisStore) GetDbConnection

func (rs *RedisStore) GetDbConnection() interface{}

func (*RedisStore) IsHealthy

func (r *RedisStore) IsHealthy() bool

func (*RedisStore) Pop

func (rs *RedisStore) Pop(queueName string) (job.JobContext, error)

func (*RedisStore) Push

func (rs *RedisStore) Push(queueName string, jb job.Job, delay ...time.Duration) error

Push supports optional delay. If delay is provided, job is scheduled in retry ZSET.

func (*RedisStore) PushBatch

func (rs *RedisStore) PushBatch(queueName string, jobs []job.Job, delay ...time.Duration) error

PushBatch adds multiple jobs to the Redis queue, supports optional delay for all jobs.

func (*RedisStore) Retry

func (rs *RedisStore) Retry(job job.Job, delay time.Duration) error

func (*RedisStore) RetryJobWithMetadata

func (rs *RedisStore) RetryJobWithMetadata(queueName string, queuedJob job.JobContext, delay ...time.Duration) error

RetryJobWithMetadata pushes a job to the retry queue with retry metadata

func (*RedisStore) Stop

func (rs *RedisStore) Stop() error

Stop gracefully stops the Redis store and its retry poller

Jump to

Keyboard shortcuts

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