hugo: Index | Files

package para

import ""

Package para implements parallel execution helpers.


Package Files


type Runner Uses

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 Uses

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 Uses

func New(numWorkers int) *Workers

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

func (*Workers) Start Uses

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

Start starts a new Runner.

Package para imports 2 packages (graph) and is imported by 6 packages. Updated 2020-12-26. Refresh now. Tools for package owners.