memory

package
v0.3.688 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const NumPriorities = 3

Variables

This section is empty.

Functions

This section is empty.

Types

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 (*MemoryMQ) Close

func (mq *MemoryMQ) Close() error

Close stops the associated goroutines by stopping the ticker

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)

Jump to

Keyboard shortcuts

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