mqs

package
v0.0.0-...-2853c3c Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const NumPriorities = 3

Variables

This section is empty.

Functions

func New

func New(mqURL string) (models.MessageQueue, error)

New will parse the URL and return the correct MQ implementation.

Types

type BoltDbConfig

type BoltDbConfig struct {
	FileName string `mapstructure:"filename"`
}

type BoltDbMQ

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

func NewBoltMQ

func NewBoltMQ(url *url.URL) (*BoltDbMQ, error)

func (*BoltDbMQ) Delete

func (mq *BoltDbMQ) Delete(ctx context.Context, job *models.Call) error

func (*BoltDbMQ) Push

func (mq *BoltDbMQ) Push(ctx context.Context, job *models.Call) (*models.Call, error)

func (*BoltDbMQ) Reserve

func (mq *BoltDbMQ) Reserve(ctx context.Context) (*models.Call, error)

func (*BoltDbMQ) Start

func (mq *BoltDbMQ) Start()

type MemoryMQ

type MemoryMQ struct {
	// WorkQueue A buffered channel that we can send work requests on.
	PriorityQueues []chan *models.Call
	Ticker         *time.Ticker
	BTree          *btree.BTree
	Timeouts       map[string]*callItem
	// Protects B-tree and Timeouts
	// If this becomes a bottleneck, consider separating the two mutexes. The
	// goroutine to clear up timed out messages could also become a bottleneck at
	// some point. May need to switch to bucketing of some sort.
	Mutex sync.Mutex
}

func NewMemoryMQ

func NewMemoryMQ() *MemoryMQ

func (*MemoryMQ) Delete

func (mq *MemoryMQ) Delete(ctx context.Context, job *models.Call) error

func (*MemoryMQ) Push

func (mq *MemoryMQ) Push(ctx context.Context, job *models.Call) (*models.Call, error)

func (*MemoryMQ) Reserve

func (mq *MemoryMQ) Reserve(ctx context.Context) (*models.Call, error)

type Mock

type Mock struct {
	FakeApp   *models.App
	Apps      []*models.App
	FakeRoute *models.Route
	Routes    []*models.Route
}

func (*Mock) Delete

func (mock *Mock) Delete(context.Context, *models.Call) error

func (*Mock) Push

func (mock *Mock) Push(context.Context, *models.Call) (*models.Call, error)

func (*Mock) Reserve

func (mock *Mock) Reserve(context.Context) (*models.Call, error)

type RedisMQ

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

func NewRedisMQ

func NewRedisMQ(url *url.URL) (*RedisMQ, error)

func (*RedisMQ) Delete

func (mq *RedisMQ) Delete(ctx context.Context, job *models.Call) error

func (*RedisMQ) Push

func (mq *RedisMQ) Push(ctx context.Context, job *models.Call) (*models.Call, error)

func (*RedisMQ) Reserve

func (mq *RedisMQ) Reserve(ctx context.Context) (*models.Call, error)

Would be nice to switch to this model http://redis.io/commands/rpoplpush#pattern-reliable-queue

Jump to

Keyboard shortcuts

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