Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

enhance auto(…) to detect missing dependencies #263

Closed
RubyTuesdayDONO opened this Issue · 2 comments

3 participants

RubyTuesdayDONO Brian Maissy Caolan McMahon
RubyTuesdayDONO

i'm not sure whether this is by design or not, but it would aid troubleshooting if auto(…) could (optionally?) detect when one of its tasks has unsatisfied dependencies. although developers should certainly be careful, it would be so helpful if auto(…) were to call out something like, task 'unreachable' has unsatisfied dependency on task 'nonexistent'.

var async = require('async'); 
async.auto({ 
    unreachable: [ 'nonexistent', function(callback) { 
        console.log('this message will not appear'); 
        callback(); 
    } ] 
}, function(err,res) { 
    if(err) { 
        console.dir(err); 
        process.exit(1); 
    } else { 
        process.exit(0); 
    } 
} 
Brian Maissy

The simple case of a nonexistent dependency should definitely be implemented, since it costs almost nothing and would solve a common programmer error. To find loops in the dependencies would also be possible, but would take some extra processing. Still not a bad idea I think.

Obviously beyond that there's nothing much we can do.

RubyTuesdayDONO

dependency cycles could either throw an error or be converted into equal siblings with no children … better to throw an error in my use-cases (and probably simpler), although there are applications for everything :p

Caolan McMahon caolan closed this
Ben Gourley bengourley referenced this issue in microadam/component-loader
Closed

Doesn't fail if a dependency is not loaded #1

Mickael van der Beek Mickael-van-der-Beek referenced this issue from a commit in Mickael-van-der-Beek/async
Mickael van der Beek Mickael-van-der-Beek Fixes caolan/async#263 and other dependency issues by detecting dead-…
…locks and throwing an Error.
ceb46c9
Mickael van der Beek Mickael-van-der-Beek referenced this issue from a commit in Mickael-van-der-Beek/async
Mickael van der Beek Mickael-van-der-Beek Fixes caolan/async#263 and other dependency issues by detecting dead-…
…locks and throwing an Error.
2410077
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.