我怎样才能接近红宝石背景工作者

时间:2020-12-25 20:48:43

I am creating a stock market game on rails. Here I have a scenario where I want explore what are different approaches in running background jobs in ruby.

我正在铁轨上创建一个股市游戏。在这里,我有一个场景,我想探索在ruby中运行后台作业的不同方法。

Scenario: This application will have users. User will add other users as friends. Now my application will compare scores of these users and will send email to the user, if his/her friend is performing better than him/her to inspire him/her. Again app will be sending emails to user if he hasn't logged in in last 2 weeks. So mail triggers are away duration (> 2weeks) and user and their friends score comparison.

场景:此应用程序将拥有用户。用户将其他用户添加为朋友。现在我的应用程序将比较这些用户的分数,并将向用户发送电子邮件,如果他/她的朋友比他/她表现更好以激励他/她。如果他在过去两周内没有登录,应用程序将再次向用户发送电子邮件。所以邮件触发器的持续时间(> 2周)和用户及其朋友的得分进行比较。

Points of discussion:

讨论点:

  • I have briefly gone through Delayed_job, Resque. What would be the best library?

    我简要介绍了Delayed_job,Resque。什么是最好的图书馆?

  • If I want write a cron job in shell or other language will be more fast as in performance?

    如果我想用shell或其他语言写一个cron作业会比性能更快吗?

  • Does above library uses separate processes for each queue or they use separate threads.

    上面的库是为每个队列使用单独的进程还是使用单独的线程。

Please advice me on how should I approach this scenario.

请告诉我如何处理这种情况。

Thanks in advance!

提前致谢!

1 个解决方案

#1


1  

Using the whenever gem to control cron jobs is great:

使用when gem来控制cron作业非常棒:

http://railscasts.com/episodes/164-cron-in-ruby

http://railscasts.com/episodes/164-cron-in-ruby

I would look at trying at least two from all available.

我会考虑尝试至少两个可用的。

I would also focus a lot on getting a serious, realistic, volume of seed data ready for testing if not yet done.

我还将重点关注如果尚未完成的话,可以获得一个严肃,真实,大量的种子数据。

#1


1  

Using the whenever gem to control cron jobs is great:

使用when gem来控制cron作业非常棒:

http://railscasts.com/episodes/164-cron-in-ruby

http://railscasts.com/episodes/164-cron-in-ruby

I would look at trying at least two from all available.

我会考虑尝试至少两个可用的。

I would also focus a lot on getting a serious, realistic, volume of seed data ready for testing if not yet done.

我还将重点关注如果尚未完成的话,可以获得一个严肃,真实,大量的种子数据。