Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/cordeno/deps.ts>DenoAsync.MuxAsyncIterator

🦕 A Discord API wrapper for developing discord bots using the Deno runtime.
Latest
class DenoAsync.MuxAsyncIterator
implements AsyncIterable<T>
import { DenoAsync } from "https://deno.land/x/cordeno@v0.3.5/deps.ts";
const { MuxAsyncIterator } = DenoAsync;

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>