I have an odd scenario I think, or at least haven't had this much of a challenge with my Javascript or any language for that matter... The pseudo is messing me up basically/logic stuff.
So I want to run a queue/callback-bypass through web-socket so when a message comes in I can process it one by one but if it's a callback I let it run every-time.
The issue I run into is I store the messages in a queue and unsure how to program my nextMessage statement to handle running queued items but clearing a callback message and not losing order.
My code now is being modified on the go so posting it is tough,
But say if I wanted to allow regular messages that can have instant response run but callback messages maximum priority without screwing up the order.
I'm dealing with the issue where if too many messages are routing at once I may summon two or more messages and bring things out of sync. So if users who write games or do stateless operations got a perfect queuing method with brain power behind it with web-sockets willing to hear it out.
I'll be coding to sort this but working off a MessageHandle/NextMessage function but seeing I can't just call next every-time or need to re-think my setup a bit.