combine<T> static method
OffsetIterator<T>
combine<T>(
- Iterable<
OffsetIterator< iterators, {T> > - String name = 'OffsetIterator.combine',
- bool closeOnError = true,
- SeedCallback<
T> ? seed,
Combine multiple OffsetIterator's into one.
Implementation
static OffsetIterator<T> combine<T>(
Iterable<OffsetIterator<T>> iterators, {
String name = 'OffsetIterator.combine',
bool closeOnError = true,
SeedCallback<T>? seed,
}) {
final c = OffsetIteratorController<T>(
name: name,
closeOnError: closeOnError,
seed: seed,
);
Future.wait(iterators.map((i) => i.pipe(c, closeOnDrained: false)))
.whenComplete(c.close);
return c.iterator as OffsetIterator<T>;
}