operationqueue

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LevelDBQueue

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

LevelDBQueue implements an operation queue that's backed by a LevelDB persistent store

func (*LevelDBQueue) Add

func (q *LevelDBQueue) Add(op *operation.QueuedOperation, protocolGenesisTime uint64) (uint, error)

Add adds the given operation to the tail of the queue

func (*LevelDBQueue) Close

func (q *LevelDBQueue) Close()

Close closes the database

func (*LevelDBQueue) Drop

func (q *LevelDBQueue) Drop() error

Drop deletes the database. Note that the queue must be closed before this operation may be performed.

func (*LevelDBQueue) Len

func (q *LevelDBQueue) Len() uint

Len returns the number of operation in the queue

func (*LevelDBQueue) Peek

Peek returns the given number of operation at the head of the queue without removing them.

func (*LevelDBQueue) Remove

func (q *LevelDBQueue) Remove(num uint) (uint, uint, error)

Remove removes the given number of operation from the head of the queue. The operation are returned along with the new size of the queue and any error.

type Provider

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

Provider manages operation queues

func NewProvider

func NewProvider(cfg peerConfig) *Provider

NewProvider returns a new Operation LevelDBQueue provider

func (*Provider) Close

func (p *Provider) Close()

Close closes all databases

func (*Provider) Create

func (p *Provider) Create(channelID, namespace string) (cutter.OperationQueue, error)

Create returns the operation queue for the given channel

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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