queue

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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