So, the only issue is that your callback is called multiple times, right?
 
In that case you can make a counter, which you increase when you're creating callback and decrease when your callback is called. If it's zero again, the work is finished.
 
Here is a gist code which'll hopefully answer this:
https://gist.github.com/rlidwka/8a375c02042eaf0b05b0
 
 
// copying message to personal email, because mailing list is too slow because of pre-moderation nowadays, and I suppose you want the answer quickly
 
16.11.2014, 17:52, "Alexey Slaykovsky" <[email protected]>:
Hello, guys! I need help.
I wrote a code which takes one object, another object and then changes values of that second object.
And this code is nice for me. It makes this transformation async and nonblocking. But! I need my output (https://gist.github.com/slaykovsky/ac72e85a116617fb761d) only once at the end.
And I don't know how to do that. I posted question like that one on stackoverflow, but that one is dead.
Help me please. I really need to do that.

 

--
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/f0caceea-a1d6-4de3-9b80-81efefb5006f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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/16591416151496%40web5o.yandex.ru.
For more options, visit https://groups.google.com/d/optout.

Reply via email to