async

package
v0.10.9 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteAsync

func ExecuteAsync(n int, f func(i int) (interface{}, error)) ([]interface{}, error)

ExecuteAsync executes the given function f up to n times concurrently, populating the given results slice with the results of each function call. Each call is done in a separate goroutine. On each iteration, the function f will be called with a unique sequential index i such that the index can be used to reference an element in an array or slice. If an error is returned by the function f for any index, an error will be returned. Otherwise, a nil result will be returned once all function calls have completed.

func ExecuteOrderedAsync

func ExecuteOrderedAsync(n int, f func(i int) (interface{}, error)) ([]interface{}, error)

ExecuteOrderedAsync executes the given function f up to n times concurrently, populating the given results slice with the results of each function call. Each call is done in a separate goroutine. On each iteration, the function f will be called with a unique sequential index i such that the index can be used to reference an element in an array or slice. If an error is returned by the function f for any index, an error will be returned. Otherwise, a nil result will be returned once all function calls have completed.

func IterAsync

func IterAsync(n int, f func(i int) error) error

IterAsync executes the given function f up to n times concurrently. Each call is done in a separate goroutine. On each iteration, the function f will be called with a unique sequential index i such that the index can be used to reference an element in an array or slice. If an error is returned by the function f for any index, an error will be returned. Otherwise, a nil result will be returned once all function calls have completed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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