diff options
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/active_job_basics.md | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/guides/source/active_job_basics.md b/guides/source/active_job_basics.md index 58e828d1b5..4632ea1faf 100644 --- a/guides/source/active_job_basics.md +++ b/guides/source/active_job_basics.md @@ -105,8 +105,8 @@ Active Job has adapters for the following queueing backends: * [Delayed Job](https://github.com/collectiveidea/delayed_job) * [Qu](https://github.com/bkeepers/qu) * [Que](https://github.com/chanks/que) -* [QueueClassic](https://github.com/ryandotsmith/queue_classic) -* [Resque 1.x](https://github.com/resque/resque) +* [QueueClassic 2.x](https://github.com/ryandotsmith/queue_classic/tree/v2.2.3) +* [Resque 1.x](https://github.com/resque/resque/tree/1-x-stable) * [Sidekiq](https://github.com/mperham/sidekiq) * [Sneakers](https://github.com/jondot/sneakers) * [Sucker Punch](https://github.com/brandonhilkert/sucker_punch) @@ -119,12 +119,12 @@ Active Job has adapters for the following queueing backends: | **Delayed Job** | Yes | Yes | Yes | Job | Global | Global | | **Que** | Yes | Yes | Yes | Job | No | Job | | **Queue Classic** | Yes | Yes | Gem | No | No | No | -| **Resque** | Yes | Yes | Gem | Queue | Global | ? | +| **Resque** | Yes | Yes | Gem | Queue | Global | Yes | | **Sidekiq** | Yes | Yes | Yes | Queue | No | Job | | **Sneakers** | Yes | Yes | No | Queue | Queue | No | | **Sucker Punch** | Yes | Yes | Yes | No | No | No | -| **Active Job** | Yes | Yes | WIP | No | No | No | | **Active Job Inline** | No | Yes | N/A | N/A | N/A | N/A | +| **Active Job** | Yes | Yes | Yes | No | No | No | ### Change Backends @@ -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 |