Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrPanicRecovered = errors.New("panic recovered")
ErrPanicRecovered is the base error for panic recovery.
Functions ¶
func Do ¶
Do runs the given functions in parallel and returns the first error encountered. See SimultaneouslyCtx for more information.
func DoCtx ¶
DoCtx runs the given functions in parallel and returns the first error encountered. If no error is encountered, it returns nil. In the event that an error happens, all other functions are canceled (via their context) to hopefully save on CPU cycles. It's up to the individual functions to check their context and return early if they are canceled.
The maxConcurrent parameter is used to limit the number of functions that run at the same time. If maxConcurrent is less than 1, all functions will run at the same time.
Panics that occur within the callback functions are automatically recovered and converted to errors. This prevents a single panicking function from crashing the entire process.