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, undefined>;
    [dispose](): void;
    close(): void;

Type Parameters

  • T


  • AsyncIterable<T>
    • CloseableAsyncIterable


  • Returns AsyncIterator<T, any, undefined>

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

    Returns void