开发者

Rails Repetitive Background Job

开发者 https://www.devze.com 2023-03-08 16:31 出处:网络
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 th

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号