redis

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New[J queue.Job](name string, conn ConnexionConfig, c ...ConfigFunc) queue.Queue[J]

Types

type Config

type Config = struct {
	Name   string
	Redis  ConnexionConfig
	Config QueueConfig
}

type ConfigFunc

type ConfigFunc = func(q *QueueConfig)

func WithPollDuration

func WithPollDuration(duration time.Duration) ConfigFunc

func WithPrefetchLimit

func WithPrefetchLimit(limit int64) ConfigFunc

func WithSerializer added in v0.0.2

func WithSerializer(in func(v any) ([]byte, error), out func(data []byte) (any, error)) ConfigFunc

func WithTimeout

func WithTimeout(t time.Duration) ConfigFunc

type ConnexionConfig

type ConnexionConfig = struct {
	Host     string
	Username string
	Password string
	Port     string
	DB       int
	Prefix   string
}

type QueueConfig

type QueueConfig = struct {
	PrefetchLimit int64         // default 10
	PollDuration  time.Duration // default 1s
	Timeout       time.Duration // default 5s
	Serialize     func(any) ([]byte, error)
	Deserialize   func([]byte) (any, error)
}

func DefaultConfig

func DefaultConfig() QueueConfig

Jump to

Keyboard shortcuts

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