workers

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FetcherJob

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

FetcherJob represent a job to crawl rates at given block

func NewFetcherJob

func NewFetcherJob(c *cli.Context, order int, block uint64, addrs []string, attempts int) *FetcherJob

NewFetcherJob return an instance of FetcherJob

type Pool

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

Pool represents a group of workers

func NewPool

func NewPool(sugar *zap.SugaredLogger, maxWorkers int, rateStorage storage.ReserveRatesStorage) *Pool

NewPool returns a pool of workers

func (*Pool) ErrCh

func (p *Pool) ErrCh() chan error

ErrCh returns error reporting channel of workers pool.

func (*Pool) GetLastCompleteJobOrder

func (p *Pool) GetLastCompleteJobOrder() int

GetLastCompleteJobOrder return the order of the latest completed job

func (*Pool) Run

func (p *Pool) Run(j job)

Run puts new job to queue

func (*Pool) Shutdown

func (p *Pool) Shutdown()

Shutdown stops the workers pool

Jump to

Keyboard shortcuts

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