QueueClassic/queue_classic

ActiveJob non-default queue name?

Closed this issue · 4 comments

I understand that both Rails 4.2 and queue_classic's support for ActiveJob is bleeding edge at the moment, and forgive me if I'm missing something obvious here.

Given the following job:

class PutHelloJob < ActiveJob::Base
  queue_as :my_job

  def perform(*args)
    puts "hello!"
  end
end

And calling PutHelloJob.perform_later somewhere in my code won't yield anything from the worker process. But if I change the name of the queue to default it works.

Rails issue? QueueClassic issue? Or operator error?

Working off of master branch.

The new deliver_later method in ActionMailer uses the mailers queue name, which means that won't work either.

Doh! Shoulda read the manaul.

On second thought, maybe I'll re-open this. After looking at the readme I learned that I can specify non-default queues via an environment variable, e.g:

QUEUES="mailers, my_job" bundle exec rake qc:work

This will execute jobs queued as "mailers", but nothing queued as "my_job" or "default". It's only running whatever I list as the first queue.

@nozpheratu I think it might be picky and you might have to remove the space in the QUEUES here...not sure, I'll have to take a look, but this works for sure, we've been using that in production for months now @rainforestapp.

That said, I didn't try with Rails 4.2 on a non-default queue yet...let me know if it works or not.

Thanks!

@jipiboily Good call, removing the spaces in the quotes fixed it. I'll report any other issues I run into. 😄