aboutsummaryrefslogtreecommitdiffstats
path: root/activejob
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2016-02-05 15:35:37 +0100
committerDavid Heinemeier Hansson <david@loudthinking.com>2016-02-05 15:35:37 +0100
commit625baa69d14881ac49ba2e5c7d9cac4b222d7022 (patch)
treeb290cf57c085ec8ea17b2af49172e5e3141a6ea2 /activejob
parent7fe32d28a8e73bfa826773c5a8777a316126cd38 (diff)
downloadrails-625baa69d14881ac49ba2e5c7d9cac4b222d7022.tar.gz
rails-625baa69d14881ac49ba2e5c7d9cac4b222d7022.tar.bz2
rails-625baa69d14881ac49ba2e5c7d9cac4b222d7022.zip
Change the default adapter from inline to async
Diffstat (limited to 'activejob')
-rw-r--r--activejob/CHANGELOG.md7
-rw-r--r--activejob/lib/active_job/queue_adapter.rb6
2 files changed, 10 insertions, 3 deletions
diff --git a/activejob/CHANGELOG.md b/activejob/CHANGELOG.md
index 981b6a20ec..229ef03879 100644
--- a/activejob/CHANGELOG.md
+++ b/activejob/CHANGELOG.md
@@ -1,3 +1,10 @@
+* Change the default adapter from inline to async. It's a better default as tests will then not mistakenly
+ come to rely on behavior happening synchronously. This is especially important with things like jobs kicked off
+ in Active Record lifecycle callbacks.
+
+ *DHH*
+
+
## Rails 5.0.0.beta2 (February 01, 2016) ##
* No changes.
diff --git a/activejob/lib/active_job/queue_adapter.rb b/activejob/lib/active_job/queue_adapter.rb
index 457015b741..7dfdd0ae5c 100644
--- a/activejob/lib/active_job/queue_adapter.rb
+++ b/activejob/lib/active_job/queue_adapter.rb
@@ -10,19 +10,19 @@ module ActiveJob
included do
class_attribute :_queue_adapter, instance_accessor: false, instance_predicate: false
- self.queue_adapter = :inline
+ self.queue_adapter = :async
end
# Includes the setter method for changing the active queue adapter.
module ClassMethods
# Returns the backend queue provider. The default queue adapter
- # is the +:inline+ queue. See QueueAdapters for more information.
+ # is the +:async+ queue. See QueueAdapters for more information.
def queue_adapter
_queue_adapter
end
# Specify the backend queue provider. The default queue adapter
- # is the +:inline+ queue. See QueueAdapters for more
+ # is the +:async+ queue. See QueueAdapters for more
# information.
def queue_adapter=(name_or_adapter_or_class)
self._queue_adapter = interpret_adapter(name_or_adapter_or_class)