I'm trying to send an SMS for a function. But the problem is: The function takes about 10-15 seconds to finish (Since we do bunch of stuff with PhantomJS).
_.each(users, function(userData){ // This does not work since i need to wait for 15 seconds
smsFree.sendSMSFree(userData, productUrl);
});
I've even tried using setTimeout but that didn't quite work as well.
I'm on NodeJS. How can I leverage Async or some other library to solve my problem?
I want to wait for 15 seconds then loop to the second object. Not sure how this is achieved. (Async.serial?)
No comments:
Post a Comment