blockpoller

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 18 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockFetcher

type BlockFetcher interface {
	IsBlockAvailable(requestedSlot uint64) bool
	Fetch(ctx context.Context, blkNum uint64) (b *pbbstream.Block, skipped bool, err error)
}

type BlockHandler

type BlockHandler interface {
	Init()
	Handle(blk *pbbstream.Block) error
}

type BlockItem added in v1.2.0

type BlockItem struct {
	// contains filtered or unexported fields
}

type BlockPoller

type BlockPoller struct {
	*shutter.Shutter
	// contains filtered or unexported fields
}

func New

func New(
	blockFetcher BlockFetcher,
	blockHandler BlockHandler,
	opts ...Option,
) *BlockPoller

func (*BlockPoller) Run

func (p *BlockPoller) Run(ctx context.Context, startBlockNum uint64, blockFetchBatchSize int) error

type FireBlockHandler

type FireBlockHandler struct {
	// contains filtered or unexported fields
}

func NewFireBlockHandler

func NewFireBlockHandler(blockTypeURL string) *FireBlockHandler

func (*FireBlockHandler) Handle

func (f *FireBlockHandler) Handle(b *pbbstream.Block) error

func (*FireBlockHandler) Init

func (f *FireBlockHandler) Init()

type Option

type Option func(*BlockPoller)

func IgnoreCursor

func IgnoreCursor() Option

IgnoreCursor ensures the poller will ignore the cursor and start from the startBlockNum the cursor will still be saved as the poller progresses

func WithBlockFetchRetryCount

func WithBlockFetchRetryCount(v uint64) Option

func WithLogger

func WithLogger(logger *zap.Logger) Option

func WithStoringState

func WithStoringState(stateStorePath string) Option

type State

type State string
const (
	ContinuousSegState State = "CONTINUOUS"
	IncompleteSegState State = "INCOMPLETE"
)

func (State) String

func (s State) String() string

Jump to

Keyboard shortcuts

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