parallel

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func Init

func Init(workercount int)

func Run

func Run(task Task, waiter *Waiter)

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func New

func New(workercount int) *Manager

func (*Manager) Close

func (p *Manager) Close()

Close waits all tasks to finish.

func (*Manager) Run

func (p *Manager) Run(fn Task, waiter *Waiter)

Run runs the given task while limiting the concurrency.

type Task

type Task func() error

type Waiter

type Waiter struct {
	// contains filtered or unexported fields
}

func NewWaiter

func NewWaiter() *Waiter

func (*Waiter) Err

func (w *Waiter) Err() <-chan error

func (*Waiter) Wait

func (w *Waiter) Wait()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL