This commit is contained in:
Alex Hultman
2019-01-21 09:13:17 +01:00
parent db3eaed955
commit e3adce28fb
4 changed files with 15 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
{
"name": "uWebSockets.js",
"version": "0.0.6",
"version": "0.0.7",
"main": "uws.js"
}

16
uws.js
View File

@@ -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());

Binary file not shown.

Binary file not shown.