I like DelayedJob's feature of different "priorities" in the same queue 
largely for conservation of resources. I don't need to have multiple 
processes running in order to make some things more important than others.

Use Case A: My site has bursty traffic, and I use DJ to send transactional 
emails. I usually have 0 jobs in the queue, but occasionally it gets busy. 
It's much more important to me that a "password reset" email gets picked 
first, even if there are 20 other jobs that came in all of a sudden which 
are less important, such as generating a data export, scheduled daily admin 
reporting, or even sending the "welcome" emails.

Use Case B: I have a low-priority cleanup job that reschedules itself for 5 
minutes later after it completes. It doesn't matter if it gets pushed back 
to a later time based on other jobs that need to happen. I'd rather not 
have to run some other process to manage this job / this specific queue.

I suppose the argument could be made that the underlying library should 
have a configuration utility to be able to turn queue names into 
priorities, but by nature that would involve more configuration (first 
assign a queue, then assign a priority to that queue), as opposed to just 
being able to set a priority without configuring the queue name. DJ started 
with priorities only, and added queue names later (after other libraries 
became popular). Queues are for sure more sophisticated of a technique, but 
using priorities is often simpler and "good enough" - until your job 
management needs have outgrown DJ / SQL-based options, and you need to 
transition to another solution.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to