mergeBroadcast<T> static method

Stream<T> mergeBroadcast<T>(
  1. Iterable<Stream<T>> streams
)

Merges the events from streams into a single broadcast stream.

This is equivalent to adding streams to a broadcast group, closing that group, and returning its stream.

Implementation

static Stream<T> mergeBroadcast<T>(Iterable<Stream<T>> streams) {
  var group = StreamGroup<T>.broadcast();
  streams.forEach(group.add);
  group.close();
  return group.stream;
}