My question:
How can I implement a timer for an auction?
- Timer needs to run on the server
- Since there are going to be many timers I don't want to waste a lot of resources on the function that runs the timer.
I am using play framework 2.1.1 and AKKA.
Can I store the timer in the database? updating it on retrieval?
I guess you can get inspiration from the Java Comet Clock sample coming with Play framework
https://github.com/playframework/Play20/tree/master/samples/java/comet-clock
It use Akka for scheduling and Comet to push data to clients. Maybe your can use a better push solution like websockets or server sent events (you can check the websocket chat sample for that)
And if you need to store the timer in a DB, you can do that in the Clock Actor (or equivalent).