Skip to content

Commit

Permalink
explitly calling callback on destroy to work around streams not emitt…
Browse files Browse the repository at this point in the history
…ing close
  • Loading branch information
mafintosh committed Nov 24, 2013
1 parent 0eda9e5 commit b1aa5ee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ var destroyer = function(stream, reading, writing, callback) {
if (closed || destroyed || (!reading && !writing) || !stream.destroy) return;
destroyed = true;
stream.destroy();
process.nextTick(function() {
callback(new Error('stream destroyed'));
});
};
};

Expand Down

0 comments on commit b1aa5ee

Please sign in to comment.