Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBounedRunner ¶
Create a new single capacity runner - a runner we can only add tasks to as long as there is a free goroutine in the Run() loop to handle it. maxParallel - number of go routines for task processing, maxParallel always will be a positive number. failFast - if set to true the runner will stop on first error.
func NewRunner ¶
Create a new capacity runner - a runner we can add tasks to without blocking as long as the capacity is not reached. maxParallel - number of go routines for task processing, maxParallel always will be a positive number. acceptBeforeBlocking - number of tasks that can be added until a free processing goruntine is needed. failFast - is set to true the will stop on first error.
Types ¶
type OnErrorFunc ¶
type OnErrorFunc func(error)
type Runner ¶
type Runner interface { AddTask(TaskFunc) (int, error) AddTaskWithError(TaskFunc, OnErrorFunc) (int, error) Run() Done() Cancel(bool) Errors() map[int]error ActiveThreads() uint32 OpenThreads() uint32 IsStarted() bool SetMaxParallel(int) GetFinishedNotification() chan bool SetFinishedNotification(bool) ResetFinishNotificationIfActive() }