worker

package
v0.0.0-...-cdf0fd8 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: CC0-1.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	EncodingConfig *params.EncodingConfig
	Queue          types.HeightQueue
	ClientProxy    *client.Proxy
	Database       db.Database
	Modules        []modules.Module
	Logger         logging.Logger
}

func NewConfig

func NewConfig(
	queue types.HeightQueue,
	encodingConfig *params.EncodingConfig,
	clientProxy *client.Proxy,
	db db.Database,
	modules []modules.Module,
	logger logging.Logger,
) *Config

type Worker

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

Worker defines a job consumer that is responsible for getting and aggregating block and associated data and exporting it to a database.

func NewWorker

func NewWorker(index int, config *Config) Worker

NewWorker allows to create a new Worker implementation.

func (Worker) Start

func (w Worker) Start()

Start starts a worker by listening for new jobs (block heights) from the given worker queue. Any failed job is logged and re-enqueued.

Jump to

Keyboard shortcuts

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