Documentation ¶
Index ¶
- type Option
- func WithAddr(addr string) Option
- func WithChannel(channel string) Option
- func WithChannelSize(size int) Option
- func WithCluster(enable bool) Option
- func WithConnectionString(connectionString string) Option
- func WithDB(db int) Option
- func WithLogger(l queue.Logger) Option
- func WithMasterName(masterName string) Option
- func WithPassword(passwd string) Option
- func WithRunFunc(fn func(context.Context, core.QueuedMessage) error) Option
- func WithSentinel(enable bool) Option
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*options)
Option for queue system
func WithConnectionString ¶
WithConnectionString redis connection string
func WithMasterName ¶ added in v0.1.0
WithMasterName sentinel master name
func WithRunFunc ¶
WithRunFunc setup the run func of queue
func WithSentinel ¶ added in v0.1.0
WithSentinel redis sentinel
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker for Redis
func NewWorker ¶
NewWorker creates a new Worker instance with the provided options. It initializes a Redis client based on the options and establishes a connection to the Redis server. The Worker is responsible for subscribing to a Redis channel and receiving messages from it. It returns the created Worker instance.
func (*Worker) Queue ¶
func (w *Worker) Queue(job core.QueuedMessage) error
Queue send notification to queue
func (*Worker) Request ¶ added in v0.0.8
func (w *Worker) Request() (core.QueuedMessage, error)
Request a new task
Click to show internal directories.
Click to hide internal directories.