hydra

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 License: BSD-3-Clause Imports: 2 Imported by: 1

README

hydra

Just another worker pool

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Debugf(format string, args ...interface{})
	Debugln(args ...interface{})
	Println(args ...interface{})
}

type MyWG

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

func (*MyWG) Add

func (mg *MyWG) Add(delta int)

func (*MyWG) Done

func (mg *MyWG) Done()

func (*MyWG) Len

func (mg *MyWG) Len() int

func (*MyWG) Wait

func (mg *MyWG) Wait()

type Stats

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

func NewStats

func NewStats() *Stats

func (*Stats) AddGetItem

func (s *Stats) AddGetItem(delta int64)

func (*Stats) AddGetItemErrors

func (s *Stats) AddGetItemErrors(delta int64)

func (*Stats) AddProcessItem

func (s *Stats) AddProcessItem(delta int64)

func (*Stats) AddProcessItemErrors

func (s *Stats) AddProcessItemErrors(delta int64)

func (*Stats) AddStarts

func (s *Stats) AddStarts(delta int64)

func (*Stats) AddSubmitItem

func (s *Stats) AddSubmitItem(delta int64)

func (*Stats) AddSubmitItemErrors

func (s *Stats) AddSubmitItemErrors(delta int64)

func (*Stats) GetGetItem

func (s *Stats) GetGetItem() int64

func (*Stats) GetGetItemErrors

func (s *Stats) GetGetItemErrors() int64

func (*Stats) GetProcessItem

func (s *Stats) GetProcessItem() int64

func (*Stats) GetProcessItemErrors

func (s *Stats) GetProcessItemErrors() int64

func (*Stats) GetStarts

func (s *Stats) GetStarts() int64

func (*Stats) GetSubmitItem

func (s *Stats) GetSubmitItem() int64

func (*Stats) GetSubmitItemErrors

func (s *Stats) GetSubmitItemErrors() int64

type Worker

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

func New

func New(ctx context.Context, workerCount int, workerNode WorkerNode, logger Logger) *Worker

func (*Worker) Run

func (w *Worker) Run()

func (*Worker) Stats

func (w *Worker) Stats() *Stats

func (*Worker) Stop

func (w *Worker) Stop()

type WorkerNode

type WorkerNode interface {
	Process(ctx context.Context, item interface{}) (interface{}, error)
	GetItem(ctx context.Context) (interface{}, error)
	SubmitResult(ctx context.Context, result interface{}) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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