orderedmap

package
v0.2103.9 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package orderedmap implements a queue backed by an ordered map.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OrderedMap

type OrderedMap struct {
	sync.Mutex
	// contains filtered or unexported fields
}

OrderedMap is a queue backed by an ordered map.

func New

func New(maxPoolSize, maxBatchSize uint64) *OrderedMap

New returns a new incoming queue.

func (*OrderedMap) Add

func (q *OrderedMap) Add(tx []byte) error

Add adds transaction into the queue.

func (*OrderedMap) AddBatch

func (q *OrderedMap) AddBatch(batch [][]byte) error

AddBatch adds a batch of transactions into the queue.

func (*OrderedMap) Clear

func (q *OrderedMap) Clear()

Clear empties the queue.

func (*OrderedMap) GetBatch

func (q *OrderedMap) GetBatch() [][]byte

GetBatch gets a batch of transactions from the queue.

func (*OrderedMap) IsQueued

func (q *OrderedMap) IsQueued(txHash hash.Hash) bool

IsQueued checks if a transactions is already queued.

func (*OrderedMap) RemoveBatch

func (q *OrderedMap) RemoveBatch(batch [][]byte)

RemoveBatch removes a batch of transactions from the queue.

func (*OrderedMap) Size

func (q *OrderedMap) Size() uint64

Size returns size of the queue.

Jump to

Keyboard shortcuts

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