开发者

Setting up queues for resque workers with multiple similar jobs

开发者 https://www.devze.com 2023-03-26 21:43 出处:网络
I have a number of different event-driven emails being sent with action mailer (ex. send an email when a user follows you etc.) and I need to move all of this into resque workers. My question is what

I have a number of different event-driven emails being sent with action mailer (ex. send an email when a user follows you etc.) and I need to move all of this into resque workers. My question is what is the best way to set up these workers? Should I create a separate file for each type of email being sent, or would it make sense to make one file for all emails and put them each in different classes within that file? The latter makes more sense to me, and if I do that, should I assign all of the emails to th开发者_如何学编程e same queue or different queues?


This is a very subjective question as it really depends on your volume, setup, etc.

For my main project that handles a bunch of e-mail, I have a single Rails mailer class that handles all my notifications, and in turn, I have a single Resque worker to handle mailing those out, all tied to my :email queue.

You probably wouldn't really need to worry about multiple queues until performance became an issue and you needed to start giving higher priority to certain queues, etc.

0

精彩评论

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

关注公众号