// Parallel runs the given functions in parallel.
//
// It collects all the errors in the returned error. To obtain
// the multiple errors, use the `Errors` function.
Parallel runs the given functions in parallel.

It collects all the errors in the returned error. To obtain
the multiple errors, use the `Errors` function.
// Parallel runs the given functions in parallel . // // It collects all the errors in the returned error . To obtain // the multiple errors use the ` Errors ` function .
func (f *Flow) Parallel(ctx context.Context, fns ...Func) error {
	if len(fns) == 0 {
		return nil
	}
	results := make(chan error)
	f.runAll(len(fns), func(i int) {
		results <- fns[i](ctx)
	}, func() { close(results) })
	var errs multiError
	for err := range results {
		if err != nil {
			errs = append(errs, err)
		}
	}
	return errs.ErrorOrNil()
}
func ( f * Flow ) Parallel ( ctx context . Context , fns ... Func ) error { if len ( fns ) == 0 { return nil } results := make ( chan error ) f . runAll ( len ( fns ) , func ( i int ) { results <- fns [ i ] ( ctx ) } , func ( ) { close ( results ) } ) var errs multiError for err := range results { if err != nil { errs = append ( errs , err ) } } return errs . ErrorOrNil ( ) }
Parallel runs the given functions in parallel.
Parallel runs the given functions in parallel .