Back to

Package para

Latest Go to latest

The latest major version is .

Published: Sep 15, 2020 | License: Apache-2.0 | Module:


Package para implements parallel execution helpers.


type Runner

type Runner interface {
	Run(func() error)
	Wait() error

Runner wraps the lifecycle methods of a new task set.

Run wil block until a worker is available or the context is cancelled, and then run the given func in a new goroutine. Wait will wait for all the running goroutines to finish.

type Workers

type Workers struct {
	// contains filtered or unexported fields

Workers configures a task executor with the most number of tasks to be executed in parallel.

func New

func New(numWorkers int) *Workers

New creates a new Workers with the given number of workers.

func (*Workers) Start

func (w *Workers) Start(ctx context.Context) (Runner, context.Context)

Start starts a new Runner.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier