delay_queue

package
v0.0.0-...-41aba7b Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BeanstalkDelayQueue

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

func NewBeanstalkDelayQueue

func NewBeanstalkDelayQueue(addr string) (*BeanstalkDelayQueue, error)

func (*BeanstalkDelayQueue) Close

func (delayQueue *BeanstalkDelayQueue) Close() error

func (*BeanstalkDelayQueue) Delete

func (delayQueue *BeanstalkDelayQueue) Delete(topic string, id string) error

func (*BeanstalkDelayQueue) Put

func (delayQueue *BeanstalkDelayQueue) Put(topic string, priority uint32, delay, ttr time.Duration, task Task) error

func (*BeanstalkDelayQueue) Update

func (delayQueue *BeanstalkDelayQueue) Update(topic string, id string, priority uint32, delay time.Duration) error

func (*BeanstalkDelayQueue) Watch

func (delayQueue *BeanstalkDelayQueue) Watch(handle TaskHandle, topic ...string)

type Conn

type Conn struct {
	*beanstalk.Conn
}

type DelayQueue

type DelayQueue interface {
	Watch(handle TaskHandle, topic ...string)
	Put(topic string, priority uint32, delay, ttr time.Duration, task Task) error
	Delete(topic string, taskId string) error
	Update(topic string, taskId string, priority uint32, delay time.Duration) error
	Close() error
}

type Task

type Task struct {
	SequenceId string
	Body       []byte
}

type TaskHandle

type TaskHandle = func(taskId string, task Task)

Jump to

Keyboard shortcuts

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