parallel

package module
v0.1.2 Latest Latest
Warning

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

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

README

Parallel utilities for golang

Please read parallel_for_test.go for examples.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func For

func For(n int, fn func(i int, total int) error) error

For will execute N goroutines, wait them complete, and gather errors.

The callback `fn` takes two parameters: the offset of goroutine and the total size of goroutines.

Types

type Future added in v0.1.1

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

func NewFuture added in v0.1.1

func NewFuture(fn func() (interface{}, error)) *Future

func (*Future) Get added in v0.1.1

func (fut *Future) Get() (interface{}, error)

func (*Future) IsComplete added in v0.1.1

func (fut *Future) IsComplete() bool

type Notification added in v0.1.2

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

func NewNotification added in v0.1.2

func NewNotification() *Notification

func (*Notification) Done added in v0.1.2

func (n *Notification) Done()

func (*Notification) Wait added in v0.1.2

func (n *Notification) Wait()

Jump to

Keyboard shortcuts

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