fix(core): update

This commit is contained in:
Philipp Kunz 2023-11-13 18:41:04 +01:00
parent d48ef6eb43
commit 22df9dfd94
3 changed files with 1 additions and 5 deletions

View File

@ -7,7 +7,6 @@ tap.test('should run backpressure test', async (toolsArg) => {
const stream1 = new SmartDuplex({ const stream1 = new SmartDuplex({
name: 'stream1', name: 'stream1',
objectMode: true, objectMode: true,
handleBackpressure: true,
writeFunction: async (chunk, tools) => { writeFunction: async (chunk, tools) => {
await new Promise((resolve) => setTimeout(resolve, 10)); // Slow processing await new Promise((resolve) => setTimeout(resolve, 10)); // Slow processing
console.log(`processed chunk ${chunk} in stream 1`); console.log(`processed chunk ${chunk} in stream 1`);
@ -17,7 +16,6 @@ tap.test('should run backpressure test', async (toolsArg) => {
const stream2 = new SmartDuplex({ const stream2 = new SmartDuplex({
name: 'stream2', name: 'stream2',
objectMode: true, objectMode: true,
handleBackpressure: true,
writeFunction: async (chunk, tools) => { writeFunction: async (chunk, tools) => {
await new Promise((resolve) => setTimeout(resolve, 20)); // Slow processing await new Promise((resolve) => setTimeout(resolve, 20)); // Slow processing
console.log(`processed chunk ${chunk} in stream 2`); console.log(`processed chunk ${chunk} in stream 2`);
@ -27,7 +25,6 @@ tap.test('should run backpressure test', async (toolsArg) => {
const stream3 = new SmartDuplex({ const stream3 = new SmartDuplex({
objectMode: true, objectMode: true,
name: 'stream3', name: 'stream3',
handleBackpressure: true,
writeFunction: async (chunk, tools) => { writeFunction: async (chunk, tools) => {
await new Promise((resolve) => setTimeout(resolve, 100)); // Slow processing await new Promise((resolve) => setTimeout(resolve, 100)); // Slow processing
console.log(`processed chunk ${chunk} in stream 3`); console.log(`processed chunk ${chunk} in stream 3`);

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@push.rocks/smartstream', name: '@push.rocks/smartstream',
version: '3.0.22', version: '3.0.23',
description: 'simplifies access to node streams' description: 'simplifies access to node streams'
} }

View File

@ -17,7 +17,6 @@ export interface IStreamFinalFunction<rT> {
export interface ISmartDuplexOptions<TInput, TOutput> extends DuplexOptions { export interface ISmartDuplexOptions<TInput, TOutput> extends DuplexOptions {
debug?: boolean; debug?: boolean;
name?: string; name?: string;
handleBackpressure?: boolean;
readFunction?: () => Promise<void>; readFunction?: () => Promise<void>;
writeFunction?: IStreamWriteFunction<TInput, TOutput>; writeFunction?: IStreamWriteFunction<TInput, TOutput>;
finalFunction?: IStreamFinalFunction<TOutput>; finalFunction?: IStreamFinalFunction<TOutput>;