Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/std/util/async.ts>MuxAsyncIterator

A modern runtime for JavaScript and TypeScript.
Go to Latest
class MuxAsyncIterator
implements AsyncIterable<T>
import { MuxAsyncIterator } from "https://deno.land/x/deno@v0.28.0/std/util/async.ts";

The MuxAsyncIterator class multiplexes multiple async iterators into a single stream. It currently makes a few assumptions:

  • The iterators do not throw.
  • The final result (the value returned and not yielded from the iterator) does not matter; if there is any, it is discarded.

Properties

private
iteratorCount: number
private
signal: Deferred<void>
private
yields: Array<TaggedYieldedValue<T>>

Methods

private
callIteratorNext(iterator: AsyncIterableIterator<T>): Promise<void>
add(iterator: AsyncIterableIterator<T>): void
iterate(): AsyncIterableIterator<T>
[Symbol.asyncIterator](): AsyncIterableIterator<T>