import { AsyncPushIterator } from "https://deno.land/x/gauntlet@v0.0.9/imports/mod.ts";
An AsyncPushIterator is an AsyncIterator that allows pushing data asynchronously. The constructor accepts a setup function which is responsible for setting up the pushing logic (e.g. event listeners) and may return a teardown function which should clean up anything that was done during setup (e.g. removing event listeners). The setup function is called once when the iterator is actually iterated.
Constructors
new
AsyncPushIterator(setup: AsyncPushIteratorSetup<T>)Properties
protected
queue: T[]protected
setup: AsyncPushIteratorSetup<T>Methods
protected
continue(): voidprotected
teardownOnce(): voidprotected
wait(): Promise<void>finish(): void
Let the iterator finish, i.e. already pushed values will be iterated, but new values are not accepted. After all pushed values are iterated, the iterator returns (stops).
[Symbol.asyncIterator](): this