Created
July 21, 2015 06:00
-
-
Save zackproser/b50c944edcdd85bef9af to your computer and use it in GitHub Desktop.
A simple way to keep tabs on child processes in an express app.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Adds given child_process to the app-level array of running attacks so it can be terminated later | |
* | |
* @param {Object} child_process - A node child process representing a currently running attack | |
* | |
* @return void | |
*/ | |
beginTrackingAttack = function(child_process) { | |
var currentAttacks = app.get('activeAttacks'); | |
currentAttacks.push(child_process); | |
app.set('activeAttacks', currentAttacks); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment