syncRace<R> static method

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

Synchronous variant of race. Returns immediately if any competitor exposes an Arm.immediate; otherwise returns null without subscribing.

Implementation

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