I am a bit confused by the logic of the results that go from one task to another task in async.auto . For example, in the following logic of the code, I added some data to the models in task1 , which are initially derived from initialtask and in finalTask added data to the models from task1 also reflected in results.initialTask1 . Similarly, the added data in task2 reflected in results.initialTask1 in finalTask .
To summarize , all results.initialTask1 , results.task1[0] , results.task2[0] , results.task3[0] identical in finalTask . Is this the async.auto logic? Or is it something like a pointer to a C ++ pointer that causes any changes for models in task1 , is it also reflected in models in initialtask ?
async.auto({ initialTask: function(callback) { //Do some operations callback(null, name, initialModels); }, task1: ['initialTask', function(callback, results) { var models = results.initialTask[1]; //Add some more data to models callback(null, models); }], task2: ['initialTask', function(callback, results) { var models = results.initialTask[1]; //Add some more data to models callback(null, models); }], task3: ['initialTask', function(callback, results) { var models = results.initialTask[1]; //Add some more data to models callback(null, models); }], finalTask: ['task1', 'task2', 'task3', function(callback, results) { //Here the followings are the same: results.initialTask[1], results.task1[0], results.task2[0], results.task3[0] }] });
I am looking for any answer that helps me make sure that this is logic or not? I'm not necessarily looking for any white papers or ...
user3421904
source share