stream-transform
Advanced tools
Comparing version 3.2.9 to 3.2.10
@@ -29,3 +29,4 @@ | ||
started: 0, | ||
finished: 0 | ||
finished: 0, | ||
paused: false, | ||
}; | ||
@@ -40,3 +41,4 @@ return this; | ||
this.state.running++; | ||
if(this.state.running < this.options.parallel){ | ||
// Accept additionnal chunks to be processed in parallel | ||
if(!this.state.paused && this.state.running < this.options.parallel){ | ||
cb(); | ||
@@ -51,3 +53,4 @@ cb = null; // Cancel further callback execution | ||
if(l === 1){ // sync | ||
this.__done(null, [this.handler.call(this, chunk, this.options.params)], cb); | ||
const result = this.handler.call(this, chunk, this.options.params); | ||
this.__done(null, [result], cb); | ||
}else if(l === 2){ // async | ||
@@ -87,5 +90,6 @@ const callback = (err, ...chunks) => | ||
if(chunk !== undefined && chunk !== null && chunk !== ''){ | ||
this.push(chunk); | ||
this.state.paused = !this.push(chunk); | ||
} | ||
} | ||
// Chunk has been processed | ||
if(cb){ | ||
@@ -92,0 +96,0 @@ cb(); |
{ | ||
"version": "3.2.9", | ||
"version": "3.2.10", | ||
"name": "stream-transform", | ||
@@ -116,3 +116,3 @@ "description": "Object transformations implementing the Node.js `stream.Transform` API", | ||
}, | ||
"gitHead": "632c10eb8a9a27749b58831fe6c4ead43ad63354" | ||
"gitHead": "79939aee56c467ab8f866eac3ebc591279b2f6f2" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
973560
28134