worker

package
v0.5.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBlockProcessed  = errors.New("block already processed")
	ErrBlockProcessing = errors.New("block is processing right now")
	ErrBlockError      = errors.New("block processed with error")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	ProcessErrorBlocksInterval time.Duration `env:"PROCESS_ERROR_BLOCKS_INTERVAL" envDefault:"1m"`
	ProcessNewBlocks           bool          `env:"SUBSCRIBE_NEW_BLOCKS"` // FIXME: or use ws enabled???
	ProcessErrorBlocks         bool          `env:"PROCESS_ERROR_BLOCKS" envDefault:"true"`
	MetricsEnabled             bool          `env:"METRICS_ENABLED" envDefault:"false"`
	RecoveryMode               bool          `env:"RECOVERY_MODE" envDefault:"false"`
	ProcessGenesis             bool          `env:"PROCESS_GENESIS" envDefault:"true"`
	WorkersCount               int           `env:"WORKERS_COUNT" envDefault:"1"`
	StartHeight                int64         `env:"START_HEIGHT" envDefault:"-1"`
	StopHeight                 int64         `env:"STOP_HEIGHT"`
}

type Worker

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

func New

func New(cfg Config, l zerolog.Logger, b rep.Broker, rpcCli rep.RPCClient, grpcCli rep.GrpcClient,
	modules []types.Module, s rep.Storage, marshaler codec.Codec, tbM tb.ToBroker, tsM ts.ToStorage) *Worker

func (*Worker) Start

func (w *Worker) Start(_ context.Context) error

func (*Worker) Stop

func (w *Worker) Stop(_ context.Context) error

Jump to

Keyboard shortcuts

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