repeatingtask

package
v0.13.11 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2025 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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