Wednesday, 7 June 2017

Alternative to node timers

I am developing a game made up of several boards where each board features a timer.

That timer keeps track of the maximum time an user has to perform an action but if ALL the users perform the given action before the time expires then it should be restarted in order to start a new round.

Well, I was thinking of creating a timer on server side like for instance a setTimout for each board and store it in an array so that I can cancel it on demand but that way I will have as many timers in memory as the number of boards.

My concern is basically related to scalability, if the number of boards go up insanely then I might face some memory problems.

All in all, I really would like to know what alternatives can you think of for this scenario that are more "memory-friendly" and scalable as well? For instance, how would you handle this challenge in a language that has no built-in timers?



via utxeee

No comments:

Post a Comment