inmemory

package
v0.0.0-...-71312fb Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2018 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BTreeJobRegistry

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

BTreeJobRegistry implements a JobRegistry backed by a BTree.

func NewBTreeJobRegistry

func NewBTreeJobRegistry(btree *btree.BTree) *BTreeJobRegistry

NewBTreeJobRegistry returns a new BTreeJobRegistry backed by btree.

func (*BTreeJobRegistry) DeleteByID

func (i *BTreeJobRegistry) DeleteByID(id geanstalkd.JobID) error

DeleteByID deletes a job previously inserted. It returns geanstalkd.ErrJobMissing if the job could not be found.

func (*BTreeJobRegistry) GetByID

func (i *BTreeJobRegistry) GetByID(id geanstalkd.JobID) (*geanstalkd.Job, error)

GetByID queries a job with the given JobID. It returns the geanstalkd.ErrJobMissing error if the job could not be found.

func (*BTreeJobRegistry) GetLargestID

func (i *BTreeJobRegistry) GetLargestID() (geanstalkd.JobID, error)

GetLargestID returns the largest JobID for the jobs stored in this BTreeJobRegistry.

func (*BTreeJobRegistry) Insert

func (i *BTreeJobRegistry) Insert(j *geanstalkd.Job) error

Insert inserts a new job. It returns geanstalkd.ErrJobAlreadyExist if a job with the same ID already has been inserted.

func (*BTreeJobRegistry) Update

func (i *BTreeJobRegistry) Update(j *geanstalkd.Job) error

Update updates a previously inserted job. It returns geanstalkd.ErrJobMissing if it can't find a job with the given ID.

type JobHeapPriorityQueue

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

JobHeapPriorityQueue is an in-memory geanstalkd.JobPriorityQueue implementation backed by a heap. Use NewJobHeapPriorityQueue to create one.

func NewJobHeapPriorityQueue

func NewJobHeapPriorityQueue() *JobHeapPriorityQueue

NewJobHeapPriorityQueue returns a new JobHeapPriorityQueue ready for immediate use.

func (*JobHeapPriorityQueue) Peek

func (h *JobHeapPriorityQueue) Peek() (*geanstalkd.Job, error)

Peek returns the job which would be returned if Pop() is called. geanstalkd.ErrEmptyQueue is returned if the queue is empty.

func (*JobHeapPriorityQueue) Pop

Pop removes and returns the job with the highest priority. geanstalkd.ErrEmptyQueue is returned if the queue is empty.

func (*JobHeapPriorityQueue) Push

Push adds a new job. If a job with the given ID already has been pushed, geanstalkd.ErrJobAlreadyExist is returned.

func (*JobHeapPriorityQueue) RemoveByID

func (h *JobHeapPriorityQueue) RemoveByID(jid geanstalkd.JobID) error

RemoveByID removed a job with given ID previously pushed to this queue. geanstalkd.ErrJobMissing if a job with the given ID could not be found.

func (*JobHeapPriorityQueue) Update

func (h *JobHeapPriorityQueue) Update(j *geanstalkd.Job) error

Update modifies a job previously pushed.

type TubeHeapPriorityQueue

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

TubeHeapPriorityQueue is an in-memory geanstalkd.TubePriorityQueue implementation backed by a heap. Use NewTubeHeapPriorityQueue to create one.

func NewTubeHeapPriorityQueue

func NewTubeHeapPriorityQueue() *TubeHeapPriorityQueue

NewTubeHeapPriorityQueue is returns a new TubeHeapPriorityQueue ready for immediate use.

func (*TubeHeapPriorityQueue) FixByTube

func (h *TubeHeapPriorityQueue) FixByTube(tube geanstalkd.Tube) error

FixByTube modifies a JobPriorityQueue previously modified.

func (*TubeHeapPriorityQueue) Peek

Peek returns the job which would be returned if Pop() is called. geanstalkd.ErrEmptyQueue is returned if the queue is empty.

func (*TubeHeapPriorityQueue) Push

Push adds a new job. If a job with the given ID already has been pushed, geanstalkd.ErrJobAlreadyExist is returned.

func (*TubeHeapPriorityQueue) RemoveByTube

func (h *TubeHeapPriorityQueue) RemoveByTube(name geanstalkd.Tube) error

RemoveByTube removed a job with given ID previously pushed to this queue. geanstalkd.ErrJobMissing if a job with the given ID could not be found.

Jump to

Keyboard shortcuts

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