joyent/node — pull request #6316 by bnoordhuis (2013-10-07 13:46:44+00:00)
Title: 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.

TODO: Still needs documentation.
Suggested reviewer: @tjfontaine @sam-github