I try find solutions like "Promices" or modules like "synchronize" or "sync", but I donsen't fine a properly solution ):
The way its I have like 10 tables 'user', 'data', 'game'. And functions like:
getUsers(){} // UserTable
getData(){} // DataModel
getGames(){} // GameTable
getUserByGames(){} // UserModel
And some funtions have needs to return me a model or table... and in some cases I need that model or that 'answer' to make another query and another stuff.
So, i need to do synchronous querys to make that in the best way, no use '.then' or stuff like that :/
Did you know how I can doit in nodejs?
(Maybe a solution can be put a flag in true each async function and in the callback change the flag to false. With a while for dosent end the original function?)
You can mix callbacks, sequential and parallel execution, loops, recursion with SynJS. Here is an example to illustrate:
It produces following output: