delayqueue

package
v0.0.0-...-f79bcc6 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Drive    string       `yaml:"drive"`    // 驱动 redis
	Name     string       `yaml:"name"`     // 队列名字
	RedisCfg redis.Config `yaml:"redisCfg"` //
}

type DealFunc

type DealFunc func(msg string) error

type DelayQueue

type DelayQueue interface {
	Producer(msg string, expireTime int64) error
	Consumer(dealFunc DealFunc)
}

func New

func New(config Config) (queue DelayQueue, err error)

type QueueByRedis

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

func (*QueueByRedis) Consumer

func (q *QueueByRedis) Consumer(dealFunc DealFunc)

func (*QueueByRedis) Producer

func (q *QueueByRedis) Producer(msg string, expireTime int64) (err error)

func (*QueueByRedis) Stop

func (q *QueueByRedis) Stop()

Jump to

Keyboard shortcuts

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