Documentation
¶
Index ¶
- func All(funcs ...func(context.Context) error) (int, error)
- func AllCompleted(funcs ...func(context.Context) error) ([]error, bool)
- func AllCompletedWithContext(ctx context.Context, funcs ...func(context.Context) error) ([]error, bool)
- func AllWithContext(ctx context.Context, funcs ...func(context.Context) error) (int, error)
- func Race(funcs ...func(context.Context) error) (int, error)
- func RaceWithContext(ctx context.Context, funcs ...func(context.Context) error) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func All ¶
All executes the functions asynchronously until all functions have been finished. If some function returns an error or panic, it will immediately return the index of the function and the error, and send a cancel signal to all other functions by context.
The index of the function will be -1 if all functions have been completed without error or panic.
func AllCompleted ¶
AllCompleted executes the functions asynchronously until all functions have been finished. It will return an error slice that is ordered by the functions order, and a boolean value to indicate whether any functions return an error or panic.
func AllCompletedWithContext ¶
func AllCompletedWithContext( ctx context.Context, funcs ...func(context.Context) error, ) ([]error, bool)
AllCompletedWithContext executes the functions asynchronously until all functions have been finished, or the context is done (canceled or timeout). It will return an error slice that is ordered by the functions order, and a boolean value to indicate whether any functions return an error or panic.
func AllWithContext ¶
AllWithContext executes the functions asynchronously until all functions have been finished, or the context is done (canceled or timeout). If some function returns an error or panic, it will immediately return the index of the index and the error and send a cancel signal to all other functions by context.
The index of the function will be -1 if all functions have been completed without error or panic, or the context has been canceled (or timeout) before all functions finished.
func Race ¶
Race executes the functions asynchronously, it will return the index and the result of the first of the finished function (including panic), and it will not send a cancel signal to other functions.
func RaceWithContext ¶
RaceWithContext executes the functions asynchronously, it will return the index and the result of the first of the finished function (including panic), and it will not send a cancel signal to other functions.
Types ¶
This section is empty.