fix(core): update

This commit is contained in:
2023-11-13 21:38:12 +01:00
parent 703dc11c6c
commit 12bb125bdc
5 changed files with 13 additions and 26 deletions

View File

@ -19,15 +19,15 @@ tap.test('should run backpressure test', async (toolsArg) => {
writeFunction: async (chunk, tools) => {
await new Promise((resolve) => setTimeout(resolve, 20)); // Slow processing
console.log(`processed chunk ${chunk} in stream 2`);
// await tools.push(chunk);
return chunk;
await tools.push(chunk);
// return chunk;
},
}); // This stream processes data more slowly
const stream3 = new SmartDuplex({
objectMode: true,
name: 'stream3',
writeFunction: async (chunk, tools) => {
await new Promise((resolve) => setTimeout(resolve, 100)); // Slow processing
await new Promise((resolve) => setTimeout(resolve, 200)); // Slow processing
console.log(`processed chunk ${chunk} in stream 3`);
},
});