Recommand · December 8, 2021 0

How to handle async array allocation with nodeJS

so let’s say I have an array of user data in nodeJS server and I need to edit that data in the array depending on the client messages. What’s the best way to go about this? Do I need to make a queue and lock / unlock the array?

If that’s the best way then I would do something make a queue array and every time I get a new message I push to the queue and then have a setinterval run every half second maybe which processes the queue while popping them off, etc etc.

There is easier way right? xD