queue

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrQueueFull = errors.New("queue full")

Functions

This section is empty.

Types

type Queue

type Queue[Tx any] struct {
	// contains filtered or unexported fields
}

Queue asynchronously inserts batches of txs in FIFO order.

func New

func New[Tx any](name string, insert func(txs []*Tx) []error, maxSize int) *Queue[Tx]

New creates a new queue. name distinguishes this queue's metrics from other queue instances (e.g. "evm" vs "cosmos").

func (*Queue[Tx]) Close

func (iq *Queue[Tx]) Close()

Close stops the main loop of the queue.

func (*Queue[Tx]) Push

func (iq *Queue[Tx]) Push(tx *Tx) <-chan error

Push enqueues a Tx's to eventually be inserted. Returns a channel that will have an error pushed to it if an error occurs inserting the Tx.

Jump to

Keyboard shortcuts

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