Currently, I am working on processing a queue of promises (which are representations of messages) in a specific order and using AngularJS for the task.
Just to give you an idea, let's say that I have a method called connect()
which returns a promise for establishing a connection, followed by msgQueue
, which is essentially a JavaScript array consisting of promises where each represents a message.
To kick things off, my initial steps would involve:
connect().then(function(){
return msgQueue.dequeue();
});
// Figuring out how to handle async looping through all the messages... Any suggestions?
I must admit that I am relatively new to Defer/Promise concepts, so any patience or guidance from experienced folks like you will be greatly appreciated!
Thank you in advance!