mputil

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WorkerResults

type WorkerResults struct {
	Offset int
	Extent interface{}
}

WorkerResults are the results of a scatter worker.

func Scatter

func Scatter(inputLen int, sFunc func(int, int, *sync.RWMutex) (interface{}, error)) ([]*WorkerResults, error)

Scatter scatters a computation across multiple goroutines. This breaks the task in to a number of chunks and executes those chunks in parallel with the function provided. Results returned are collected and presented a a set of WorkerResults, which can be reassembled by the calling function. Any error that occurs in the workers will be passed back to the calling function.

Jump to

Keyboard shortcuts

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