Last active
December 16, 2015 22:18
-
-
Save davetapley/5505590 to your computer and use it in GitHub Desktop.
Keep doing work until told to stop.
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
var timer, | |
work = function () { | |
asyncWork(function(err) { | |
timer = setTimeout(work, 10000); | |
} | |
}, | |
exports.start = function () { | |
work(); | |
}, | |
exports.stop = function () { | |
clearTimeout(timer); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment