1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Active Job guide: Add info about queue_name prefix and clarity supporter features

This commit is contained in:
Cristian Bica 2014-08-22 17:53:31 +03:00
parent 9b61a7eda9
commit 94a7a863d3

View file

@ -150,8 +150,29 @@ class GuestsCleanupJob < ActiveJob::Base
end
```
NOTE: Make sure your queueing backend "listens" on your queue name. For some backends
you need to specify the queues to listen to.
Also you can prefix the queue name for all your jobs using
`config.active_job.queue_name_prefix` in `application.rb`:
```ruby
# config/application.rb
module YourApp
class Application < Rails::Application
config.active_job.queue_name_prefix = Rails.env
end
end
# app/jobs/guests_cleanup.rb
class GuestsCleanupJob < ActiveJob::Base
queue_as :low_priority
#....
end
# Now your job will run on queue production_low_priority on your production
# environment and on beta_low_priority on your beta environment
```
NOTE: Make sure your queueing backend "listens" on your queue name. For some
backends you need to specify the queues to listen to.
Callbacks