diff --git a/package.json b/package.json index a55e3fb4..daf7e58f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { "name": "uWebSockets.js", - "version": "0.0.6", + "version": "0.0.7", "main": "uws.js" } diff --git a/uws.js b/uws.js index c16c3cde..2f418a76 100644 --- a/uws.js +++ b/uws.js @@ -18,8 +18,20 @@ module.exports = (() => { try { const uWS = require(`./uws_${process.platform}_${process.versions.modules}.node`); - /* We are not compatible with Node.js domain */ - process.nextTick = (f, ...args) => uWS.nextTick(() => f(...args)); + /* We are not compatible with Node.js nextTick and/or domains */ + process.nextTick = (f, ...args) => { + uWS.nextTick(() => { + f(...args); + }); + }; + process.on('beforeExit', () => { + if (uWS.processNextTickQueue()) { + setImmediate(() => { + + }); + } + }); + /* process.nextTick = setImmediate; */ return uWS; } catch (e) { throw new Error('This version of µWS is not compatible with your Node.js build.\n\n' + e.toString()); diff --git a/uws_linux_64.node b/uws_linux_64.node index 548451d6..5e3cf8d4 100755 Binary files a/uws_linux_64.node and b/uws_linux_64.node differ diff --git a/uws_linux_67.node b/uws_linux_67.node index 6edad6f1..ace94491 100755 Binary files a/uws_linux_67.node and b/uws_linux_67.node differ