modules/orionode/lib/graceful-cluster/graceful-cluster.js
function fork() {
            cluster.fork().on('message', function(message) {
                if (message.cmd === 'restart' && message.pid && restartQueue.indexOf(message.pid) === -1) {
                    // When worker asks to restart gracefully in cluster, then add it to restart queue.
                    log('Cluster graceful shutdown: queued. pid=' + message.pid);
                    restartQueue.push(message.pid);
                    checkRestartQueue();
                }
            });
        }
function fork() {
            cluster.fork().on('message', function(message) {
                if (message.cmd === 'restart' && message.pid && restartQueue.indexOf(message.pid) === -1) {
                    // When worker asks to restart gracefully in cluster, then add it to restart queue.
                    log('Cluster graceful shutdown: queued. pid=' + message.pid);
                    restartQueue.push(message.pid);
                    checkRestartQueue();
                }
            });
        }
function fork ( ) { cluster . fork ( ) . on ( 'message' , function ( message ) { if ( message . cmd === 'restart' && message . pid && restartQueue . indexOf ( message . pid ) === - 1 ) { // When worker asks to restart gracefully in cluster, then add it to restart queue. log ( 'Cluster graceful shutdown: queued. pid=' + message . pid ) ; restartQueue . push ( message . pid ) ; checkRestartQueue ( ) ; } } ) ; }
Create fork with 'on restart' message event listener.
Create fork with on restart message event listener .