@naturalcycles/nodejs-lib
Version:
Standard library for Node.js
33 lines (32 loc) • 1.07 kB
TypeScript
import { Readable } from 'node:stream';
import type { ReadableTyped } from '@naturalcycles/nodejs-lib/stream';
import type { TransformOptions } from '../stream.model.js';
/**
* Allows to combine multiple Readables into 1 Readable.
* As soon as any of the input Readables emit - the output Readable emits
* (passes through).
* Order is not preserved in any way, first come first served!
*
* Readable completes when all input Readables complete.
*
* @experimental
*/
export declare class ReadableCombined<T> extends Readable implements ReadableTyped<T> {
inputs: Readable[];
static create<T>(inputs: Readable[], opt?: TransformOptions): ReadableCombined<T>;
private constructor();
private logger;
/**
* If defined - we are in Paused mode
* and should await the lock to be resolved before proceeding.
*
* If not defined - we are in Flowing mode, no limits in data flow.
*/
private lock?;
private countIn;
private countOut;
private countReads;
private run;
_read(): void;
private logStats;
}