consequential

package
v0.8.0-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConSequential

type ConSequential struct {
	*Config

	sync.RWMutex
	// contains filtered or unexported fields
}

ConSequential is short for CONcurrent SEQUENTIAL

func NewConSequential

func NewConSequential(config *Config) (*ConSequential, error)

NewConSequential creates a new ConSequential struct

func (*ConSequential) Start

func (cs *ConSequential) Start() error

Start starts workers concurrently

type Config

type Config struct {
	StartJobID          uint32
	EndJobID            uint32
	JobBufSize          uint32
	WorkerPoolSize      uint32
	MaxWorkerFails      uint32
	WorkerStartInterval time.Duration
	RunJob              RunJob
	FinishJob           FinishJob
}

Config is the ConSequential config.

type FinishJob

type FinishJob func(jobID uint32, result interface{}) (success bool)

FinishJob finish a job with job id, returns whether success

type RunJob

type RunJob func(workerID, jobID uint32) (result interface{}, success bool)

RunJob runs a job with job id, returns result and whether success

Jump to

Keyboard shortcuts

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