pool

package
v0.0.0-...-fd3cab2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry[T any] struct {
	Item     T
	Verified *bool
}

type Pool

type Pool[T any] struct {
	// contains filtered or unexported fields
}

func NewPool

func NewPool[T any](maxItemsPerSender int) *Pool[T]

func (*Pool[M]) Entries

func (p *Pool[M]) Entries(seqNr uint64) map[commontypes.OracleID]*Entry[M]

func (*Pool[M]) EntriesWithMinSeqNr

func (p *Pool[M]) EntriesWithMinSeqNr() map[commontypes.OracleID]*Entry[M]

func (*Pool[T]) Put

func (p *Pool[T]) Put(seqNr uint64, sender commontypes.OracleID, item T) PutResult

func (*Pool[M]) ReapCompleted

func (p *Pool[M]) ReapCompleted(completedSeqNr uint64)

func (*Pool[M]) StoreVerified

func (p *Pool[M]) StoreVerified(seqNr uint64, sender commontypes.OracleID, verified bool)

type PutResult

type PutResult string
const (
	PutResultOK               PutResult = "ok"
	PutResultDuplicate        PutResult = "duplicate"
	PutResultFull             PutResult = "pool is full for sender"
	PutResultAlreadyCompleted PutResult = "seqNr too low"
)

Jump to

Keyboard shortcuts

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