Documentation ¶
Overview ¶
Package leveldb contains queue implementation using LevelDB as backend storage.
Index ¶
- func NewLeveldbQueue(name, dataPath string, queueCapacity int, ephemeralDisabled bool, ...) singu.IQueue
- type LeveldbQueue
- func (q *LeveldbQueue) Destroy()
- func (q *LeveldbQueue) EphemeralSize() (int, error)
- func (q *LeveldbQueue) EphemeralStorageCapacity() (int, error)
- func (q *LeveldbQueue) Finish(id string) error
- func (q *LeveldbQueue) Init() error
- func (q *LeveldbQueue) IsEphemeralStorageEnabled() bool
- func (q *LeveldbQueue) Name() string
- func (q *LeveldbQueue) OrphanMessages(numSeconds, numMessages int) ([]*singu.QueueMessage, error)
- func (q *LeveldbQueue) Queue(msg *singu.QueueMessage) (*singu.QueueMessage, error)
- func (q *LeveldbQueue) QueueSize() (int, error)
- func (q *LeveldbQueue) QueueStorageCapacity() (int, error)
- func (q *LeveldbQueue) Requeue(id string, silent bool) (*singu.QueueMessage, error)
- func (q *LeveldbQueue) Take() (*singu.QueueMessage, error)
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) IsEphemeralStorageEnabled ¶
func (q *LeveldbQueue) IsEphemeralStorageEnabled() bool
IsEphemeralStorageEnabled implements IQueue.IsEphemeralStorageEnabled
func (*LeveldbQueue) OrphanMessages ¶
func (q *LeveldbQueue) OrphanMessages(numSeconds, numMessages int) ([]*singu.QueueMessage, error)
OrphanMessages implements IQueue.OrphanMessages
func (*LeveldbQueue) Queue ¶
func (q *LeveldbQueue) Queue(msg *singu.QueueMessage) (*singu.QueueMessage, error)
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