File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change
1
+ * Change the default adapter from inline to async. It's a better default as tests will then not mistakenly
2
+ come to rely on behavior happening synchronously. This is especially important with things like jobs kicked off
3
+ in Active Record lifecycle callbacks.
4
+
5
+ * DHH*
6
+
7
+
1
8
## Rails 5.0.0.beta2 (February 01, 2016) ##
2
9
3
10
* No changes.
Original file line number Diff line number Diff line change @@ -10,19 +10,19 @@ module QueueAdapter #:nodoc:
10
10
11
11
included do
12
12
class_attribute :_queue_adapter , instance_accessor : false , instance_predicate : false
13
- self . queue_adapter = :inline
13
+ self . queue_adapter = :async
14
14
end
15
15
16
16
# Includes the setter method for changing the active queue adapter.
17
17
module ClassMethods
18
18
# Returns the backend queue provider. The default queue adapter
19
- # is the +:inline + queue. See QueueAdapters for more information.
19
+ # is the +:async + queue. See QueueAdapters for more information.
20
20
def queue_adapter
21
21
_queue_adapter
22
22
end
23
23
24
24
# Specify the backend queue provider. The default queue adapter
25
- # is the +:inline + queue. See QueueAdapters for more
25
+ # is the +:async + queue. See QueueAdapters for more
26
26
# information.
27
27
def queue_adapter = ( name_or_adapter_or_class )
28
28
self . _queue_adapter = interpret_adapter ( name_or_adapter_or_class )
Original file line number Diff line number Diff line change @@ -109,10 +109,12 @@ That's it!
109
109
Job Execution
110
110
-------------
111
111
112
- For enqueuing and executing jobs you need to set up a queuing backend, that is to
113
- say you need to decide for a 3rd-party queuing library that Rails should use.
114
- Rails itself does not provide a sophisticated queuing system and just executes the
115
- job immediately if no adapter is set.
112
+ For enqueuing and executing jobs in production you need to set up a queuing backend,
113
+ that is to say you need to decide for a 3rd-party queuing library that Rails should use.
114
+ Rails itself only provides an in-process queuing system, which only keeps the jobs in RAM.
115
+ If the process crashes or the machine is reset, then all outstanding jobs are lost with the
116
+ default async back-end. This may be fine for smaller apps or non-critical jobs, but most
117
+ production apps will need to pick a persistent backend.
116
118
117
119
### Backends
118
120
You can’t perform that action at this time.
0 commit comments