// ParallelBoolCancelOnError runs the given functions in parallel, cancelling all if one fails.
//
// It collects all the errors and results (regardless if there were errors or not). To obtain
// the multiple errors, use the `Errors` function.
ParallelBoolCancelOnError runs the given functions in parallel, cancelling all if one fails.

It collects all the errors and results (regardless if there were errors or not). To obtain
the multiple errors, use the `Errors` function.
// ParallelBoolCancelOnError runs the given functions in parallel cancelling all if one fails . // // It collects all the errors and results ( regardless if there were errors or not ) . To obtain // the multiple errors use the ` Errors ` function .
func (f *Flow) ParallelBoolCancelOnError(ctx context.Context, fns ...BoolFunc) ([]bool, error) {
	if len(fns) == 0 {
		return nil, nil
	}
	ctx, cancel := context.WithCancel(ctx)
	defer cancel()
	c := make(chan boolResult)
	f.runAll(len(fns), func(i int) {
		item, err := fns[i](ctx)
		c <- boolResult{item, err}
	}, func() { close(c) })
	var (
		out  []bool
		errs multiError
	)
	for res := range c {
		if res.err != nil {
			cancel()
			errs = append(errs, res.err)
			continue
		}
		out = append(out, res.item)
	}
	return out, errs.ErrorOrNil()
}
func ( f * Flow ) ParallelBoolCancelOnError ( ctx context . Context , fns ... BoolFunc ) ( [ ] bool , error ) { if len ( fns ) == 0 { return nil , nil } ctx , cancel := context . WithCancel ( ctx ) defer cancel ( ) c := make ( chan boolResult ) f . runAll ( len ( fns ) , func ( i int ) { item , err := fns [ i ] ( ctx ) c <- boolResult { item , err } } , func ( ) { close ( c ) } ) var ( out [ ] bool errs multiError ) for res := range c { if res . err != nil { cancel ( ) errs = append ( errs , res . err ) continue } out = append ( out , res . item ) } return out , errs . ErrorOrNil ( ) }
ParallelBoolCancelOnError runs the given functions in parallel, cancelling all if one fails.
ParallelBoolCancelOnError runs the given functions in parallel cancelling all if one fails .