WIP Add some backpressure tests for compose

This commit is contained in:
Jerry Kurian
2019-09-07 11:04:33 -04:00
parent d5f3fd8bd8
commit cd10649d44
7 changed files with 221 additions and 66 deletions

View File

@@ -20,8 +20,7 @@ export function map<T, R>(
async transform(chunk: T, encoding, callback) {
try {
const mapped = await mapper(chunk, encoding);
this.push(mapped);
callback();
callback(null, mapped);
} catch (err) {
console.log("caught error", err.message);
callback(err);