src: emit 'beforeExit' event on process object
authorBen Noordhuis <info@bnoordhuis.nl>
Mon, 7 Oct 2013 13:39:39 +0000 (15:39 +0200)
committerFedor Indutny <fedor.indutny@gmail.com>
Fri, 28 Feb 2014 10:43:30 +0000 (14:43 +0400)
commita2eeb43deda58e7bbb8fcf24b934157992b937c0
tree759969aaddbd6c9f2155be4535eddc98ce104402
parent6e1eac744b0c1a84614568ac2b128168ce9138da
src: emit 'beforeExit' event on process object

Unlike the 'exit' event, this event allows the user to schedule more
work and thereby postpone the exit.  That also means that the
'beforeExit' event may be emitted many times, see the attached test
case for an example.

Refs #6305.
src/node.cc
test/simple/test-process-before-exit.js [new file with mode: 0644]
test/simple/test-process-exit-from-before-exit.js [new file with mode: 0644]