I want to make a game in rails (not with flash, just html). Every action should take some time to execute. For example, user can send an action to his hero “go learn “. It should lasts for 10 minutes. What’s the best way to implement it?
I want to store player tasks in my database, but how should I do their execution?
- 1 way: when user log in or do something, check his tasks and look for finished ones.
- 2 way: check tasks on my app every X seconds and look for finished ones.
- 3 way: use something like Delayed Job gem. Do you think its good for my problem?
You could use delayed job, to run the task.With that there is problem that you will have tomanage “many” workers when there is extra load on the site, but its not that bad either, its doable as long as it “runs” every task exactly after 10 minutes.
You can still use a combined approach using 1 & 2 which would generally work.