tx

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPoolCapacityExceeded = errors.New("pool capacity exceeded")

Functions

This section is empty.

Types

type Pool

type Pool interface {
	Enqueue(Transaction) error
	Dequeue() (Transaction, bool)
	Remove(tx Transaction) bool
}

func FIFOPool

func FIFOPool(cap int) Pool

FIFOPool is a First-In, First-Out transaction pool that is thread safe.

type Transaction

type Transaction []byte

func (*Transaction) Read

func (tx *Transaction) Read(r io.Reader) error

func (Transaction) Write

func (tx Transaction) Write(w io.Writer) error

type Transactions

type Transactions []Transaction

func (*Transactions) Read

func (txs *Transactions) Read(r io.Reader) error

func (Transactions) Write

func (txs Transactions) Write(w io.Writer) error

Jump to

Keyboard shortcuts

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