Interface CloseableAsyncIterable<T>

An async iterable that can be closed when the consumer does not want to read any more elements, freeing up resources that may be held by the iterable.

This type implements the Disposable interface, allowing instances to be disposed of with ECMAScript explicit resource management and the using keyword instead of calling close directly.

interface CloseableAsyncIterable<T> {
    [asyncIterator](): AsyncIterator<T, any, any>;
    [dispose](): void;
    close(): void;
}

Type Parameters

  • T

Hierarchy

  • AsyncIterable<T>
    • CloseableAsyncIterable

Methods

  • Returns AsyncIterator<T, any, any>

  • Close the iterable to free up resources when no more elements are required.

    Returns void