diff options
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/4_0_release_notes.md | 4 | ||||
-rw-r--r-- | guides/source/active_support_core_extensions.md | 12 | ||||
-rw-r--r-- | guides/source/configuring.md | 4 |
3 files changed, 14 insertions, 6 deletions
diff --git a/guides/source/4_0_release_notes.md b/guides/source/4_0_release_notes.md index 54fe49252f..c909ef1496 100644 --- a/guides/source/4_0_release_notes.md +++ b/guides/source/4_0_release_notes.md @@ -95,9 +95,9 @@ Railties * Load all environments available in `config.paths["config/environments"]`. -* Add `config.queue_consumer` to allow the default consumer to be configurable. +* Add `config.queue_consumer` to change the job queue consumer from the default `ActiveSupport::ThreadedQueueConsumer`. -* Add `Rails.queue` as an interface with a default implementation that consumes jobs in a separate thread. +* Add `Rails.queue` for processing jobs in the background. * Remove `Rack::SSL` in favour of `ActionDispatch::SSL`. diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index 645498437d..f990b4f79f 100644 --- a/guides/source/active_support_core_extensions.md +++ b/guides/source/active_support_core_extensions.md @@ -2867,8 +2867,16 @@ The method `extract!` removes and returns the key/value pairs matching the given ```ruby hash = {:a => 1, :b => 2} -rest = hash.extract!(:a) # => {:a => 1} -hash # => {:b => 2} +rest = hash.extract!(:a, :x) # => {:a => 1} # non-existing keys are ignored +hash # => {:b => 2} +``` + +The method `extract!` returns the same subclass of Hash, that the receiver is. + +```ruby +hash = {:a => 1, :b => 2}.with_indifferent_access +rest = hash.extract!(:a).class +# => ActiveSupport::HashWithIndifferentAccess ``` NOTE: Defined in `active_support/core_ext/hash/slice.rb`. diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 2131a6c6a8..26c7976c6b 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -115,9 +115,9 @@ NOTE. The `config.asset_path` configuration is ignored if the asset pipeline is * `config.middleware` allows you to configure the application's middleware. This is covered in depth in the [Configuring Middleware](#configuring-middleware) section below. -* `config.queue` configures a different queue implementation for the application. Defaults to `ActiveSupport::SynchronousQueue`. Note that, if the default queue is changed, the default `queue_consumer` is not going to be initialized, it is up to the new queue implementation to handle starting and shutting down its own consumer(s). +* `config.queue` configures the default job queue for the application. Defaults to `ActiveSupport::Queue.new` which processes jobs in a background thread. If you change the queue, you're responsible for running the jobs as well. -* `config.queue_consumer` configures a different consumer implementation for the default queue. Defaults to `ActiveSupport::ThreadedQueueConsumer`. +* `config.queue_consumer` configures a different job consumer for the default queue. Defaults to `ActiveSupport::ThreadedQueueConsumer`. The job consumer must respond to `start`. * `config.reload_classes_only_on_change` enables or disables reloading of classes only when tracked files change. By default tracks everything on autoload paths and is set to true. If `config.cache_classes` is true, this option is ignored. |