import { PushIterable } from "https://deno.land/x/proc@0.20.5/legacy/mod.ts";
Invert the normal data flow of an AsyncIterable
, allowing you to push writes on one side and
iterate on the other.
The write()
side must call close()
when all write operations are done.
Properties
private
queue: QueueEntry<Some<T> | None>[]Methods
private
addEmptyPromiseToQueue(): voidAdd an unresolved promise to the end of the queue.
close(): void
Close the iterable.
Once closed, subsequent calls to write(...)
will throw an error.
It is safe to call close()
multiple times.
[Symbol.asyncIterator](): AsyncIterableIterator<T>