repeatingtask

package
v0.7.20 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InfiniteFailures = -1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

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

func NewPool

func NewPool(ctx context.Context, maxTasks int, numWorkers int) (*Pool, error)

func (*Pool) SubmitTask

func (p *Pool) SubmitTask(task *Task) error

func (*Pool) SubmitTaskAndWait

func (p *Pool) SubmitTaskAndWait(task *Task) TaskErrors

type Task

type Task struct {
	NumReptitions  int
	MaxParallel    int
	Handler        func(interface{}, int) error
	OnCompleteChan chan struct{}
	Timeout        time.Duration
	ErrorsChan     chan *TaskError
	MaxNumErrors   int
	Cookie         interface{}
	// contains filtered or unexported fields
}

func (*Task) Wait

func (t *Task) Wait() TaskErrors

type TaskError

type TaskError struct {
	Repetition int
	Error      error
}

type TaskErrors

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

func (*TaskErrors) Error

func (te *TaskErrors) Error() error

func (*TaskErrors) String

func (te *TaskErrors) String() string

type TaskGroup

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

func NewTaskGroup

func NewTaskGroup() (*TaskGroup, error)

func (*TaskGroup) AddTask

func (t *TaskGroup) AddTask(task *Task) error

func (*TaskGroup) Wait

func (t *TaskGroup) Wait() TaskGroupErrors

type TaskGroupErrors

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

func (*TaskGroupErrors) Error

func (tge *TaskGroupErrors) Error() error

func (*TaskGroupErrors) Errors

func (tge *TaskGroupErrors) Errors() []error

Jump to

Keyboard shortcuts

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