// RaceBool runs all functions in parallel and returns the results of the first that completes.
//
// Completion means a function either errors or succeeds.
// The result of the succeeded function is returned, the other results are
// discarded.
RaceBool runs all functions in parallel and returns the results of the first that completes.

Completion means a function either errors or succeeds.
The result of the succeeded function is returned, the other results are
discarded.
// RaceBool runs all functions in parallel and returns the results of the first that completes . // // Completion means a function either errors or succeeds . // The result of the succeeded function is returned the other results are // discarded .
func (f *Flow) RaceBool(ctx context.Context, fns ...BoolFunc) (bool, error) {
	if len(fns) == 0 {
		return false, nil
	}
	ctx, cancel := context.WithCancel(ctx)
	defer cancel()
	results := make(chan boolResult)
	f.runAll(len(fns), func(i int) {
		item, err := fns[i](ctx)
		results <- boolResult{item, err}
	}, func() { close(results) })
	res := <-results
	cancel()
	for range results {
	}
	return res.item, res.err
}
func ( f * Flow ) RaceBool ( ctx context . Context , fns ... BoolFunc ) ( bool , error ) { if len ( fns ) == 0 { return false , nil } ctx , cancel := context . WithCancel ( ctx ) defer cancel ( ) results := make ( chan boolResult ) f . runAll ( len ( fns ) , func ( i int ) { item , err := fns [ i ] ( ctx ) results <- boolResult { item , err } } , func ( ) { close ( results ) } ) res := <- results cancel ( ) for range results { } return res . item , res . err }
RaceBool runs all functions in parallel and returns the results of the first that completes.
RaceBool runs all functions in parallel and returns the results of the first that completes .