aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/active_job_basics.md
diff options
context:
space:
mode:
authorMingdong Luo <mdluo@nsmss.com>2015-01-31 19:23:48 -0800
committerMingdong Luo <mdluo@nsmss.com>2015-01-31 19:23:48 -0800
commit549d171a90135999e3c670f489494b7a39dd6dd7 (patch)
tree233466527b797fe3ea7c6a7a3673795cea28aebe /guides/source/active_job_basics.md
parentc840b18ac31a852d99ff760229f2c087b6961727 (diff)
parent70ac072976c8cc6f013f0df3777e54ccae3f4f8c (diff)
downloadrails-549d171a90135999e3c670f489494b7a39dd6dd7.tar.gz
rails-549d171a90135999e3c670f489494b7a39dd6dd7.tar.bz2
rails-549d171a90135999e3c670f489494b7a39dd6dd7.zip
Merge branch 'master' into pr/18316
Conflicts: activerecord/CHANGELOG.md
Diffstat (limited to 'guides/source/active_job_basics.md')
-rw-r--r--guides/source/active_job_basics.md21
1 files changed, 11 insertions, 10 deletions
diff --git a/guides/source/active_job_basics.md b/guides/source/active_job_basics.md
index 3046a62778..4d1625b28d 100644
--- a/guides/source/active_job_basics.md
+++ b/guides/source/active_job_basics.md
@@ -1,4 +1,4 @@
-**DO NOT READ THIS FILE IN GITHUB, GUIDES ARE PUBLISHED IN http://guides.rubyonrails.org.**
+**DO NOT READ THIS FILE ON GITHUB, GUIDES ARE PUBLISHED ON http://guides.rubyonrails.org.**
Active Job Basics
=================
@@ -78,7 +78,8 @@ end
Enqueue a job like so:
```ruby
-# Enqueue a job to be performed as soon the queueing system is free.
+# Enqueue a job to be performed as soon the queueing system is
+# free.
MyJob.perform_later record
```
@@ -114,8 +115,9 @@ You can easily set your queueing backend:
# config/application.rb
module YourApp
class Application < Rails::Application
- # Be sure to have the adapter's gem in your Gemfile and follow
- # the adapter's specific installation and deployment instructions.
+ # Be sure to have the adapter's gem in your Gemfile
+ # and follow the adapter's specific installation
+ # and deployment instructions.
config.active_job.queue_adapter = :sidekiq
end
end
@@ -153,8 +155,8 @@ class GuestsCleanupJob < ActiveJob::Base
end
# Now your job will run on queue production_low_priority on your
-# production environment and on staging_low_priority on your staging
-# environment
+# production environment and on staging_low_priority
+# on your staging environment
```
The default queue name prefix delimiter is '\_'. This can be changed by setting
@@ -176,8 +178,8 @@ class GuestsCleanupJob < ActiveJob::Base
end
# Now your job will run on queue production.low_priority on your
-# production environment and on staging.low_priority on your staging
-# environment
+# production environment and on staging.low_priority
+# on your staging environment
```
If you want more control on what queue a job will be run you can pass a `:queue`
@@ -295,7 +297,7 @@ end
```
This works with any class that mixes in `GlobalID::Identification`, which
-by default has been mixed into Active Model classes.
+by default has been mixed into Active Record classes.
Exceptions
@@ -305,7 +307,6 @@ Active Job provides a way to catch exceptions raised during the execution of the
job:
```ruby
-
class GuestsCleanupJob < ActiveJob::Base
queue_as :default