waiter

package
v1.5.0-waiter0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WaitResult

type WaitResult int
const (
	Success WaitResult = iota
	Timeout
	NotFound
)

type Waiter

type Waiter interface {
	// WaitForHash takes a hash and a duration, and returns a WaitResult of
	// Success, Timeout, or NotFound. Callers should confirm that the block is not known to
	// their application before calling, but the waiter keeps a brief history of known blocks
	// to avoid race conditions. Calling applications should call cu.Done() on chain updates
	// for the waiter to process blocks. Note that blocks that get reorged out may never be
	// processed even though their hashes have been seen.
	WaitForHashResult(types.Hash, time.Duration) WaitResult

	// WaitForHash behaves like WaitForHashResult without returning a result. Callers should confirm that the
	// block is not known to their application, call WaitForHash, then check their application again.
	WaitForHash(types.Hash, time.Duration)
	// WaitForNumber takes a block number and a duration, and returns a WaitResult of
	// Success, Timeout, or NotFound. Callers should confirm that the block is not known to
	// their application before calling, but the waiter keeps a brief history of known blocks
	// to avoid race conditions. Calling applications should call pb.Done() on pending batches
	// for the waiter to process blocks. Note that depending on how blocks get processed by the
	// OrderedMessageProcessor, blocks that get reorged out may never be processed.
	WaitForNumberResult(int64, time.Duration) WaitResult
	// WaitForNumber behaves like WaitForNumberResult without returning a result. Callers should confirm that the
	// block is not known to their application, call WaitForHash, then check their application again.
	WaitForNumber(int64, time.Duration)
	Stop()
}

func NewOmpWaiter

func NewOmpWaiter(omp *delivery.OrderedMessageProcessor) Waiter

Jump to

Keyboard shortcuts

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