Class AsyncPushIterator<T>

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.

Type Parameters

  • T

Implements

  • AsyncIterator<T>

Constructors

Methods

  • 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).

    Returns void

  • Parameters

    • err: any

    Returns Promise<IteratorResult<T, any>>