Further to Sabyasachi Ghosh's answer, here are the differences between DelayedJob and Resque:
DelayedJob relies on the DB
- Requires ActiveRecord
- Uses Ruby Objects (not just references)
- Has much deeper queuing functionality (queue depth etc)
- Runs much heavier than resque
Resque relies on Redis
- Lightweight
- Runs independently of ActiveRecord
Is meant to process references (not entire objects)
Modularity
In answer to your question, I would look at modularity
Rails' is based on the principle of DRY code -- which essentially means you need to be as modular as possible (reusing code wherever you can). This leads to efficiency & simpler development cycles
In light of this, you have to observe your queueing functionality from the perspective of modularity. What does the queuing system actually do?
It queues things
Therefore, you want to include as little code as possible in the queuing system
I would create a redis instance (you can get them on Heroku), and use resque to queue specific information (such as id
or email
)
This will allow you to use resque to run through the Redis list, sending as many emails as you need