msync

package
v0.0.0-...-5ae263f Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parallel

func Parallel(count, workers int, fn func(i int))

Parallel spawns `workers` goroutines and invokes the function in each routine from `start` to `end`. It blocks until all functions return.

func ParallelChunks

func ParallelChunks(count, chunkSize, workers int, fn func(start, end int))

ParallelChunks divides the domain into chunks of "chunkSize" and feeds it to the function, with bounded concurrency of `worker` functions.

func ParallelRanges

func ParallelRanges(count, workers int, fn func(start, end int))

ParallelRanges divides up the the domain into segments and dispatches them to worker functions.

func ThrottleHead

func ThrottleHead(duration time.Duration, fn func()) func()

ThrottleTail returns a function that calls fn() at most every duration, when the first call is on the head of the duration.

func ThrottleTail

func ThrottleTail(duration time.Duration, fn func()) func()

ThrottleTail returns a function that calls fn() at most every duration, when the first call is on the tail of the duration.

Types

type Value

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

Value is an implementation of atomic.Value which does not require consistent concrete types to be stored. It must not be copied after initialization.

func (*Value) Load

func (v *Value) Load() (x interface{})

Load returns the value set by the most recent Store.

func (*Value) Store

func (v *Value) Store(x interface{})

Store sets the value of the Value to x.

Jump to

Keyboard shortcuts

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