I have about 20 standard node type methods ( function(args, callback)). Each of these functions require the previous to be completed before the next can correctly proceed. For sake of discussion I will name these functions a,b,c,d,e,f..... So because these functions do not block I have "callback hell", that looks like:
a(args, function(err) {
if(err) {
} else {
b(args, function(err) {
Looking at the documentation I am not sure if I should use 'defer', 'denodeify', or 'ninvoke'. Like I said I am new to 'Q' and am just trying to glean what I can form the docs. Can it be as simple as:
a(args)
.then(b(args))
.then(c(args))
.then(d(args))
.then(e(args))
.then(f(args))
.error(err) {
//handle error
}
.done();
Any experience with this simple scenario would be greatly appreciated and would jumpstart my understanding of Q and promises.
Thank you.