Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

now terminating the process at the next tick

  • Loading branch information...
commit bf0feb9702e47a344a6fd8e6d44a8b4b5d72cc59 1 parent ccdb3e6
Joachim Kainz authored
Showing with 7 additions and 2 deletions.
  1. +4 −1 examples/master.js
  2. +3 −1 lib/backgrounder-launcher.js
View
5 examples/master.js
@@ -47,8 +47,11 @@ backgrounder.spawn(__dirname + "/worker.js", {
break;
case 2:
break;
+ case 3:
+ console.log("Master: child idle before terminate");
+ break;
default:
- console.error("Master: unexpected idle message ", counter, message);
+ console.error("Master: unexpected idle message", counter);
}
});
});
View
4 lib/backgrounder-launcher.js
@@ -119,7 +119,9 @@ function processMessage(message) {
emitter.emit(parsed.type, parsed.content, callback);
if ("terminate" === parsed.type) {
- process.exit(0);
+ process.nextTick(function () {
+ process.exit(0);
+ });
}
}
//
Please sign in to comment.
Something went wrong with that request. Please try again.