From 7a6116b633479effe81a820d84aaf29572cc3412 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Thu, 3 May 2012 22:26:30 -0300 Subject: Add some docs and changelog entry --- guides/source/configuring.textile | 26 +++++++++++++++----------- railties/CHANGELOG.md | 4 ++++ railties/lib/rails/queueing.rb | 4 ++-- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/guides/source/configuring.textile b/guides/source/configuring.textile index 66e453c3ff..71cc972517 100644 --- a/guides/source/configuring.textile +++ b/guides/source/configuring.textile @@ -76,6 +76,17 @@ NOTE. The +config.asset_path+ configuration is ignored if the asset pipeline is * +config.consider_all_requests_local+ is a flag. If true then any error will cause detailed debugging information to be dumped in the HTTP response, and the +Rails::Info+ controller will show the application runtime context in +/rails/info/properties+. True by default in development and test environments, and false in production mode. For finer-grained control, set this to false and implement +local_request?+ in controllers to specify which requests should provide debugging information on errors. +* +config.console+ allows you to set class that will be used as console you run +rails console+. It's best to run it in +console+ block: + + +console do + # this block is called only when running console, + # so we can safely require pry here + require "pry" + config.console = Pry +end + + * +config.dependency_loading+ is a flag that allows you to disable constant autoloading setting it to false. It only has effect if +config.cache_classes+ is true, which it is by default in production mode. This flag is set to false by +config.threadsafe!+. * +config.eager_load_paths+ accepts an array of paths from which Rails will eager load on boot if cache classes is enabled. Defaults to every folder in the +app+ directory of the application. @@ -100,6 +111,10 @@ NOTE. The +config.asset_path+ configuration is ignored if the asset pipeline is * +config.preload_frameworks+ enables or disables preloading all frameworks at startup. Enabled by +config.threadsafe!+. Defaults to +nil+, so is disabled. +* +config.queue+ configures a different queue implementation for the application. Defaults to +Rails::Queueing::Queue+. 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_consumer+ configures a different consumer implementation for the default queue. Defaults to +Rails::Queueing::ThreadedConsumer+. + * +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. * +config.secret_token+ used for specifying a key which allows sessions for the application to be verified against a known secure key to prevent tampering. Applications get +config.secret_token+ initialized to a random key in +config/initializers/secret_token.rb+. @@ -122,17 +137,6 @@ WARNING: Threadsafe operation is incompatible with the normal workings of develo * +config.whiny_nils+ enables or disables warnings when a certain set of methods are invoked on +nil+ and it does not respond to them. Defaults to true in development and test environments. -* +config.console+ allows you to set class that will be used as console you run +rails console+. It's best to run it in +console+ block: - - -console do - # this block is called only when running console, - # so we can safely require pry here - require "pry" - config.console = Pry -end - - h4. Configuring Assets Rails 3.1, by default, is set up to use the +sprockets+ gem to manage assets within an application. This gem concatenates and compresses assets in order to make serving them much less painful. diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index bc34ced283..b7c042cee3 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,5 +1,9 @@ ## Rails 4.0.0 (unreleased) ## +* Add `config.queue_consumer` to allow the default consumer to be configurable. *Carlos Antonio da Silva* + +* Add Rails.queue as an interface with a default implementation that consumes jobs in a separate thread. *Yehuda Katz* + * Remove Rack::SSL in favour of ActionDispatch::SSL. *Rafael Mendonça França* * Remove Active Resource from Rails framework. *Prem Sichangrist* diff --git a/railties/lib/rails/queueing.rb b/railties/lib/rails/queueing.rb index 896dd91034..b4bc7fcd18 100644 --- a/railties/lib/rails/queueing.rb +++ b/railties/lib/rails/queueing.rb @@ -16,13 +16,13 @@ module Rails # Jobs are run in a separate thread to catch mistakes where code # assumes that the job is run in the same thread. class TestQueue < ::Queue - # Get a list of the jobs off this queue. This method may not be + # Get a list of the jobs off this queue. This method may not be # available on production queues. def jobs @que.dup end - # Drain the queue, running all jobs in a different thread. This method + # Drain the queue, running all jobs in a different thread. This method # may not be available on production queues. def drain # run the jobs in a separate thread so assumptions of synchronous -- cgit v1.2.3