UNPKG

@shutterstock/p-map-iterable

Version:

Set of classes used for async prefetching with backpressure (IterableMapper) and async flushing with backpressure (IterableQueueMapper, IterableQueueMapperSimple)

23 lines 793 B
import { BlockingQueue, BlockingQueueOptions } from './blocking-queue'; export type IterableQueueOptions = BlockingQueueOptions; /** * Exposes an `AsyncIterable` interface for the `BlockingQueue`. * * @category Low-Level */ export declare class IterableQueue<Element> extends BlockingQueue<Element> implements AsyncIterable<Element> { /** * Create a new `IterableQueue` * @param options IterableQueue options */ constructor(options?: IterableQueueOptions); [Symbol.asyncIterator](): AsyncIterator<Element>; /** * Used by the iterator returned from [Symbol.asyncIterator] * Called every time an item is needed * * @returns Iterator result */ next(): Promise<IteratorResult<Element>>; } //# sourceMappingURL=iterable-queue.d.ts.map