Skip to content

Commit

Permalink
v12 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed Jul 23, 2021
1 parent 339f25f commit 2d662c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/transport.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ function setupOnExit (stream) {
})
} else {
const fn = autoEnd.bind(null, stream)
process.on('exit', fn)
process.once('beforeExit', fn)
process.once('exit', fn)

stream.on('close', function () {
process.removeListener('beforeExit', fn)
process.removeListener('exit', fn)
})
}
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/transport-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const { Writable } = require('stream')
module.exports = (options) => {
const myTransportStream = new Writable({
autoDestroy: true,
write (chunk, enc, cb) {
console.log(chunk.toString())
cb()
Expand Down

0 comments on commit 2d662c7

Please sign in to comment.