Attempt: Retry your functions
My first NPM-published lib!
Instead of this...
logToLoggly("My log message", function(err) {
if (err) console.log("IT FAILED AGAIN DAMNIT");
else console.log("Holy crap it worked for once.");
});
Just wrap it in an Attempt, and use 'this' for the callback!
var attempt = require('attempt');
attempt(function() {
logToLoggly("My log message", this);
}, function(err) {
if (err) console.log("logToLoggly() failed after 5 attempts.");
else console.log("Success!");
});It's way more customizable, but if you want the details, check the readme
Attempt on GitHub
Hope this is useful for more people than just me ;-)






Cartoon Clouds
Mountains
Sunrise
Clouds
Green Clouds
None







a hoopy frood who really knows where his towel is. ~~~ 










Help