Thursday 14 January 2016

Help with long running commandline node process

Hey there, I'm looking to monitor for a few processing events, like SIGKILL, and respond to them. The application does nothing else. So I have something like:process.on('SIGINT', function(){//stuff}; process.on('SIGKILL', function(){//stuff}; And I want the process to continue running. I've seen a few posibilities like:setInterval(function(){}, Math.POSITIVE_INFINITY); require('net').createServer().listen(); // Grabs random port? Is there a preferred way for me to do this? This is intended to be in a docker container and to inform a clustering tool that the host is going down via an api call.

Submitted January 14, 2016 at 09:57PM by fallen77

No comments:

Post a Comment