Back to

Package workers

Latest Go to latest

The highest tagged major version is .

Published: Dec 17, 2018 | License: MIT | Module:


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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier