简体   繁体   中英

Rails Repetitive Background Job

I'm not sure what the best solution/practice is for Rails so I thought I'd ask here.

I need to have a background job or some kind of service that runs every 5 minutes to calculate the rankings for a game for tens of thousands of users, and possibly very soon, hundreds of thousands of users. The resulting array would then be accessed for each request that needs to determine a ranking.

What are people using these days for this? A cron and rake task? The daemon gem? Resque or Beanstalkd?

Thanks for listening:)

Last time I used Clockwork gem with Delayed_job for the problem like you have

We had similar requirement for an application we developed. We used

whenever for scheduling cron jobs and delayed_job for background processing.

Whenever would trigger a cron every 5 minutes which would conditionally put an entry in the delayed job queue.

We could have also used Resque . Look at the comparison between delayed_job and resque to know what works best for you.

I created The Fat Controller to solve very similar issues. It's flexible and written in C so it's also very stable and can run anything; Ruby, PHP, Python, etc.

Have a look at the website - there is more info and use cases which are perhaps applicable to your scenario.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM