race<R> static method

Future<R> race<R>(
  1. Iterable<void Function(SelectBuilder<R> b)> competitors, {
  2. bool ordered = false,
})

Compose several builders into a single race. Useful to keep related branches grouped.

Implementation

static Future<R> race<R>(
  Iterable<void Function(SelectBuilder<R> b)> competitors, {
  bool ordered = false,
}) =>
    run<R>((b) {
      for (final c in competitors) {
        c(b);
      }
    }, ordered: ordered);