Improve interface for accumulator
This commit is contained in:
@@ -58,7 +58,21 @@ class Demux extends Writable {
|
||||
this.streamsByKey[destKey] = this.construct(destKey);
|
||||
}
|
||||
if (!this.streamsByKey[destKey].write(chunk, encoding)) {
|
||||
console.log(
|
||||
"waiting drain",
|
||||
chunk,
|
||||
this._writableState.length,
|
||||
this.streamsByKey[destKey]._writableState.length,
|
||||
this.streamsByKey[destKey]._readableState.length,
|
||||
);
|
||||
this.streamsByKey[destKey].once("drain", () => {
|
||||
console.log(
|
||||
"calling cb after drain",
|
||||
chunk,
|
||||
this._writableState.length,
|
||||
this.streamsByKey[destKey]._writableState.length,
|
||||
this.streamsByKey[destKey]._readableState.length,
|
||||
);
|
||||
cb();
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user