I have the following code:

var flow = require('nimble');

exports.execute = function(data, estrategias, callback) {

    var estrategiaList = [];
    var resultList = [];

    for (var i in estrategias)
    {
            var estrategia = (function(item) {

                    return function(callbackFlow) {

                            // Cria uma nova instancia do indicador
                            var indicador = loadIndicador(item);

                            // Executa indicador
                            indicador.execute(item, data.fechamento, 
function(result) {
                                    resultList.push(result);
                            });

                            callbackFlow();
                    }

            })(estrategias[i]);

            estrategiaList.push(estrategia);
    }

    flow.parallel(estrategiaList, function() {
            callback(resultList);
    });
};




For some reason on the final flow.parallel callback `callback(resultList)` 
I'm getting the resultList empty.

I've checked that `resultList.push(result)` add successfully the result in 
the resultList array.

I think the problem is some small detail that I couldn't figured out.

Can someone help me ?

Regards. 

Kleyson Rios.

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/6f242256-9166-49f4-a45c-6435e20a142e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to