leveldb

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package leveldb contains queue implementation using LevelDB as backend storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLeveldbQueue

func NewLeveldbQueue(name, dataPath string, queueCapacity int, ephemeralDisabled bool, ephemeralCapacity int) singu.IQueue

NewLeveldbQueue creates a new LeveldbQueue instance.

  • name: queue's name
  • dataPath: root directory to store LevelDB data, actual data is stored in <name> sub-directory
  • queueCapacity: if zero or negative queue storage has unlimited capacity; otherwise number of messages can be stored in queue storage is capped by the specified number
  • ephemeralCapacity: if zero or negative ephemeral storage has unlimited capacity; otherwise ephemeral storage is capped by the specified number

Types

type LeveldbQueue

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

LeveldbQueue is LevelDB queue implementation.

  • This queue implementation does not use the pre-set message it. It always assigns assign new id for every enqueued message.

func (*LeveldbQueue) Destroy

func (q *LeveldbQueue) Destroy()

Destroy cleans up the queue instance

func (*LeveldbQueue) EphemeralSize

func (q *LeveldbQueue) EphemeralSize() (int, error)

EphemeralSize implements IQueue.EphemeralSize

func (*LeveldbQueue) EphemeralStorageCapacity

func (q *LeveldbQueue) EphemeralStorageCapacity() (int, error)

EphemeralStorageCapacity implements IQueue.EphemeralStorageCapacity

func (*LeveldbQueue) Finish

func (q *LeveldbQueue) Finish(id string) error

Finish implements IQueue.Finish

func (*LeveldbQueue) Init

func (q *LeveldbQueue) Init() error

Init initializes the queue instance

func (*LeveldbQueue) IsEphemeralStorageEnabled

func (q *LeveldbQueue) IsEphemeralStorageEnabled() bool

IsEphemeralStorageEnabled implements IQueue.IsEphemeralStorageEnabled

func (*LeveldbQueue) Name

func (q *LeveldbQueue) Name() string

Name implements IQueue.Name

func (*LeveldbQueue) OrphanMessages

func (q *LeveldbQueue) OrphanMessages(numSeconds, numMessages int) ([]*singu.QueueMessage, error)

OrphanMessages implements IQueue.OrphanMessages

func (*LeveldbQueue) Queue

Queue implements IQueue.Queue

func (*LeveldbQueue) QueueSize

func (q *LeveldbQueue) QueueSize() (int, error)

QueueSize implements IQueue.QueueSize

func (*LeveldbQueue) QueueStorageCapacity

func (q *LeveldbQueue) QueueStorageCapacity() (int, error)

QueueStorageCapacity implements IQueue.QueueStorageCapacity

func (*LeveldbQueue) Requeue

func (q *LeveldbQueue) Requeue(id string, silent bool) (*singu.QueueMessage, error)

Requeue implements IQueue.Requeue

func (*LeveldbQueue) Take

func (q *LeveldbQueue) Take() (*singu.QueueMessage, error)

Take implements IQueue.Take

Jump to

Keyboard shortcuts

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