emitter

package
v0.0.0-...-8c998e4 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

README

Package emitter

This package defines the default implementation of superwatcher.Emitter by *emitter, which is a chain-reorg-aware Ethereum log emitter.

Event logs polling in poller.Poll

The poller filters logs from a range of blocks in the private method poller.Poll.

Configuration field FilterRange determines how many new blocks the emitter would want to filter each loop.

If a known block's hash changes, poller assumes that the block was reorged, and it emits the old (reorged) logs along with good logs (if there are any) in PollerResult.

How emitter determines block numbers for poller

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmitterShutdown   = errors.New("emitter was told to shutdown - Loop context done") // emitter received a shutdown signal
	ErrMaxRetriesReached = errors.New("emitter has reached max goBackRetries")            // emitter.conf.GoBackRetries has been reached

)

Functions

func New

func New(
	conf *superwatcher.Config,
	client superwatcher.EthClient,
	stateDataGateway superwatcher.GetStateDataGateway,
	poller superwatcher.EmitterPoller,
	syncChan <-chan struct{},
	pollResultChan chan<- *superwatcher.PollerResult,
	errChan chan<- error,
) superwatcher.Emitter

Types

This section is empty.

Jump to

Keyboard shortcuts

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