Last active
August 14, 2018 16:58
-
-
Save chaiwa-berian/743d489eecb183710a420e70df977e22 to your computer and use it in GitHub Desktop.
This file contains 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
//We are triggering start but we are catching done | |
var Job = require('./nodejs_inherit_events_main_job'); //inherit from main Job | |
var job = new Job(); | |
job.on('done', function(details){ //Subscribe to the main job's done event | |
console.log('Job was completed at', details.completedOn); | |
job.removeAllListeners(); | |
}); | |
job.emit('start'); //Fire-up the main job |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment