util

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogLevel

func LogLevel(path string) zerolog.Level

LogLevel returns the best log level for the path.

func ProcessConcurrency

func ProcessConcurrency(path string) int64

ProcessConcurrency returns the best process concurrency for the path.

Types

type ScatterResult

type ScatterResult struct {
	// Offset is the offset at which the worker started.
	Offset int
	// Extent is the user-defined result of running the scatter function.
	Extent interface{}
}

ScatterResult is the result of a single scatter worker.

func Scatter

func Scatter(inputLen int, concurrency int, work func(int, int, *sync.RWMutex) (interface{}, error)) ([]*ScatterResult, error)

Scatter scatters a computation across multiple goroutines, returning a set of per-worker results

Jump to

Keyboard shortcuts

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