diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index a07fdea..cf76c88 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartstream', - version: '3.0.25', + version: '3.0.26', description: 'simplifies access to node streams' } diff --git a/ts/smartstream.classes.smartduplex.ts b/ts/smartstream.classes.smartduplex.ts index 2dec39e..dc4bbe2 100644 --- a/ts/smartstream.classes.smartduplex.ts +++ b/ts/smartstream.classes.smartduplex.ts @@ -35,7 +35,7 @@ export class SmartDuplex extends Duplex { } // INSTANCE - private backpressuredArray = new plugins.lik.BackpressuredArray(); + private backpressuredArray: plugins.lik.BackpressuredArray; public options: ISmartDuplexOptions; private observableSubscription?: plugins.smartrx.rxjs.Subscription; private debugLog(messageArg: string) { @@ -45,8 +45,11 @@ export class SmartDuplex extends Duplex { } constructor(optionsArg?: ISmartDuplexOptions) { - super(optionsArg); + super(Object.assign({ + highWaterMark: 1, + }, optionsArg)); this.options = optionsArg; + this.backpressuredArray = new plugins.lik.BackpressuredArray(this.options.highWaterMark || 1) } public async _read(size: number): Promise {