I want to call a function main() which contains a lot of asynchronous db-connection calls. I want to call this function repeatedly after an iteration of main() gets finished.
How should I do that in Nodejs? I think there is some way to use promises over here to do this. But I am not able to think in the correct direction.