Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner is a helper to execute operations in parallel and collect result/error in the end
func NewRunner ¶
func NewRunner(opts ...RunnerOption) *Runner
NewRunner creates a new instance for parallel runner
func (*Runner) Add ¶
Add will queue provided function for execution and will not immediately execute it. The order in which add was called will be used to provide the (result, error) pair
type RunnerOption ¶
type RunnerOption func(*Runner)
func WithLimit ¶
func WithLimit(l int) RunnerOption
WithLimit restricts n number of jobs executing in parallel
func WithTicket ¶ added in v0.2.0
func WithTicket(l int) RunnerOption
WithTicket restricts n number of jobs per second
Click to show internal directories.
Click to hide internal directories.