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: 14 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 trade logs from block to block

func NewFetcherJob

func NewFetcherJob(c *cli.Context, order int, from, to *big.Int, 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 which is capable of handle many jobs at a time

func NewPool

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

NewPool returns a pool of workers to handle jobs concurrently

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