Say I have two (or more) asynchronous operations op1 and op2 that call a callback function upon completion. How do I best wait for both to complete before starting op3?
I am not able to nest them inside of each other (i.e. first starting op1, then starting op2 inside of op1callback())
(I of course also do not know which of these is going to complete first, but that doesn't really matter I guess)
function op1callback {
}
function op2callback {
}
function op3 {
...
}