Reputation: 21
I'm making product auctioning website and i want to create and store timers on the server for each product. But i don't know where to store these timers. I want an event to occur when the timer for a product has elapsed so that i can calculate the winner for that product. But i don't know where to keep these timers so that their elapsed event will happen on server.
Currently I'm calling a controller action to calculate winner from the client side using Ajax. But this solution is dependent on client being on the page where Ajax calls are made. I need a solution which is not dependent on the client.
Upvotes: 2
Views: 395
Reputation: 2052
You could listen to the timers via websockets. The timers run in several threads at the server and when they are finished, you can tell the client that something has changed.
I don't know much about websockets in combination with mvc, but this is maybe a way to go
Upvotes: 2