Documentation ¶
Index ¶
- Variables
- func Backend(_ context.Context, opts ...config.Option) (backend types.Backend, err error)
- func WithAddr(addr string) config.Option
- func WithConcurrency(concurrency int) config.Option
- func WithPassword(password string) config.Option
- func WithShutdownTimeout(timeout time.Duration) config.Option
- type RedisBackend
- func (b *RedisBackend) Enqueue(ctx context.Context, job *jobs.Job) (jobID string, err error)
- func (b *RedisBackend) SetLogger(logger logging.Logger)
- func (b *RedisBackend) Shutdown(ctx context.Context)
- func (b *RedisBackend) Start(_ context.Context, queue string, h handler.Handler) (err error)
- func (b *RedisBackend) StartCron(ctx context.Context, cronSpec string, h handler.Handler) (err error)
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidAddr = errors.New("invalid connecton string: see documentation for valid connection strings")
ErrInvalidAddr indicates that the provided address is not a valid redis connection string
Functions ¶
func Backend ¶
Backend is a config.BackendInitializer that initializes a new Redis-backed neoq backend
func WithConcurrency ¶
WithConcurrency configures the number of workers available to process jobs across all queues
func WithPassword ¶
WithPassword configures neoq to connect to Redis with the given password
Types ¶
type RedisBackend ¶ added in v0.16.0
RedisBackend is a Redis-backed neoq backend nolint: revive
func (*RedisBackend) SetLogger ¶ added in v0.16.0
func (b *RedisBackend) SetLogger(logger logging.Logger)
SetLogger sets this backend's logger
func (*RedisBackend) Shutdown ¶ added in v0.16.0
func (b *RedisBackend) Shutdown(ctx context.Context)
Shutdown halts the worker
func (*RedisBackend) Start ¶ added in v0.16.0
Start starts processing jobs with the specified queue and handler
func (*RedisBackend) StartCron ¶ added in v0.16.0
func (b *RedisBackend) StartCron(ctx context.Context, cronSpec string, h handler.Handler) (err error)
StartCron starts processing jobs with the specified cron schedule and handler
See: https://pkg.go.dev/github.com/robfig/cron?#hdr-CRON_Expression_Format for details on the cron spec format