added support for accessing results of other tasks in #12

wants to merge 2 commits into


None yet
5 participants

thejh commented Feb 19, 2011

As wanted in issue #7. Usage example:{
    get_data: function(callback){
        // async code to get some data
        setTimeout(function() {
            callback(null, 'this is some data');
        }, 500);
    make_folder: function(callback){
        // async code to create a directory to store a file in
        // this is run at the same time as getting the data
        setTimeout(function() {
            callback(null, 'blahfu123');
        }, 700);
    write_file: ['get_data', 'make_folder', function(callback){
        setTimeout(function() {
        }, 700);
    email_link: ['write_file', function(callback, results){
        console.log('put "'+results.get_data+'" into "'+results.make_folder+'"');
        setTimeout(function() {
        }, 700);

ghost commented Mar 15, 2011

Exactly what i needed. Thanks for this addition.

+1 for this feature

I recommend adding the results object to the final callback. At least I have an equal need for that. That needs only three lines highlighted in this commit:

thejh commented Mar 23, 2011

Thanks, eirikurn, looks like a good idea.


brianmaissy commented Feb 20, 2013

This seems to have been implemented since the pull request was opened, so it should be closed.

@caolan caolan closed this Mar 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment