migration

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: MIT Imports: 5 Imported by: 0

README

Migration Engine

This engine is a proxy-like engine for the redis engine.

It's main purpose is to migrate a redis engine to a larger new redis engine without breaking existing clients. The migration engine will send all PUBLISH operation to the new redis engine, and CONSUME from both engines.

The authorization token used for the migration is the same as the old pool. After migration finished, we can update the config, remove the old pool and rename the new pool with the old name. The user does NOT needed to do anything.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEngine

func NewEngine(old, new engine.Engine) engine.Engine

func Setup

func Setup(conf *config.Config, l *logrus.Logger) error

Types

type Engine

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

func (*Engine) BatchConsume

func (e *Engine) BatchConsume(namespace string, queues []string, count, ttrSecond, timeoutSecond uint32) (jobs []engine.Job, err error)

BatchConsume consume some jobs of a queue

func (*Engine) Consume

func (e *Engine) Consume(namespace string, queues []string, ttrSecond, timeoutSecond uint32) (job engine.Job, err error)

func (*Engine) Delete

func (e *Engine) Delete(namespace, queue, jobID string) error

func (*Engine) DeleteDeadLetter

func (e *Engine) DeleteDeadLetter(namespace, queue string, limit int64) (count int64, err error)

func (*Engine) Destroy

func (e *Engine) Destroy(namespace, queue string) (count int64, err error)

func (*Engine) DumpInfo

func (e *Engine) DumpInfo(output io.Writer) error

func (*Engine) Peek

func (e *Engine) Peek(namespace, queue, optionalJobID string) (job engine.Job, err error)

func (*Engine) PeekDeadLetter

func (e *Engine) PeekDeadLetter(namespace, queue string) (size int64, jobID string, err error)

func (*Engine) Publish

func (e *Engine) Publish(namespace, queue string, body []byte, ttlSecond, delaySecond uint32, tries uint16) (jobID string, err error)

func (*Engine) RespawnDeadLetter

func (e *Engine) RespawnDeadLetter(namespace, queue string, limit, ttlSecond int64) (count int64, err error)

func (*Engine) Shutdown

func (e *Engine) Shutdown()

func (*Engine) Size

func (e *Engine) Size(namespace, queue string) (size int64, err error)

func (*Engine) SizeOfDeadLetter

func (e *Engine) SizeOfDeadLetter(namespace, queue string) (size int64, err error)

SizeOfDeadLetter return the queue size of dead letter

Jump to

Keyboard shortcuts

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