Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultParallelism default parallelism DefaultParallelism int = 5 )
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(handler interface{}, parInputs interface{}, parallelism int) interface{}
Run execute handler on parInputs, with automatic type conversion and maximum concurrency as parallelism Examples: > out := Run(func(x int) int { return x*x }, []int{1,2,3,4,5}, 5) < out: []int{1,4,19,16,25} > out := Run(func(x int, y string) (string, bool) { return y, x%2==0 }, [][]interface{}{{1,"n"},{2,"y"}}, 2) < out: [][]interface{{"n",false},{"y",true}}
Types ¶
Click to show internal directories.
Click to hide internal directories.