Skip to content

Commit

Permalink
Fix piping between queues
Browse files Browse the repository at this point in the history
  • Loading branch information
timursevimli committed Jan 13, 2024
1 parent 401baa2 commit 92e5926
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class Queue {
if (onFailure) onFailure(err, res);
} else if (onSuccess) onSuccess(res);
if (onDone) onDone(err, res);
if (this.destination) this.destination.add(res);
if (this.destination) this.destination.add(res.res);
if (!onDrain) return;
if (!this.roundRobinMode) {
if (this.count === 0 && this.waiting.length === 0) onDrain();
Expand Down Expand Up @@ -167,7 +167,7 @@ class Queue {
throw new Error(msg);
}
this.destination = dest;
return { pipe: dest.pipe };
return { pipe: dest.pipe.bind(dest) };
}

timeout(msec = 1, onTimeout = null) {
Expand Down

0 comments on commit 92e5926

Please sign in to comment.