stream

package
v0.0.2-0...-d05d5d5 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPreprocessFuncThreadNumber = 4

Variables

View Source
var ErrStopBlockReached = errors.New("stop block reached")

Functions

This section is empty.

Types

type ErrInvalidArg

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

func NewErrInvalidArg

func NewErrInvalidArg(m string, args ...interface{}) *ErrInvalidArg

func (*ErrInvalidArg) Error

func (e *ErrInvalidArg) Error() string

type Option

type Option = func(s *Stream)

func WithBlockIndexProvider

func WithBlockIndexProvider(p bstream.BlockIndexProvider) Option

func WithCursor

func WithCursor(cursor *bstream.Cursor) Option

func WithCustomStepTypeFilter

func WithCustomStepTypeFilter(step bstream.StepType) Option

func WithFinalBlocksOnly

func WithFinalBlocksOnly() Option

func WithLogger

func WithLogger(logger *zap.Logger) Option

func WithPreprocessFunc

func WithPreprocessFunc(pp bstream.PreprocessFunc, threads int) Option

func WithPreprocessFuncDefaultThreadNumber

func WithPreprocessFuncDefaultThreadNumber(pp bstream.PreprocessFunc) Option

func WithStopBlock

func WithStopBlock(stopBlockNum uint64) Option

func WithTargetCursor

func WithTargetCursor(cursor *bstream.Cursor) Option

type Stream

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

func New

func New(
	forkedBlocksStore dstore.Store,
	mergedBlocksStore dstore.Store,
	hub *hub.ForkableHub,
	startBlockNum int64,
	handler bstream.Handler,
	options ...Option) *Stream

func (*Stream) Run

func (s *Stream) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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