opqueue

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2020 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemQueue

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

MemQueue implements an in-memory operation queue.

func (*MemQueue) Add

func (q *MemQueue) Add(data *operation.QueuedOperation, protocolGenesisTime uint64) (uint, error)

Add adds the given data to the tail of the queue and returns the new length of the queue.

func (*MemQueue) Len

func (q *MemQueue) Len() uint

Len returns the length of the queue.

func (*MemQueue) Peek

func (q *MemQueue) Peek(num uint) ([]*operation.QueuedOperationAtTime, error)

Peek returns (up to) the given number of operations from the head of the queue but does not remove them.

func (*MemQueue) Remove

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

Remove removes (up to) the given number of items from the head of the queue. Returns the actual number of items that were removed and the new length of the queue.

Jump to

Keyboard shortcuts

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