diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2012-12-21 15:42:47 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2012-12-21 16:29:47 -0800 |
commit | f9da785d0b1b22317cfca25c15fb555e9016accb (patch) | |
tree | f54e2174e9388ebb51bc32ed9ba1aa7cc7d95a32 /railties/lib | |
parent | 10c0a3bd113c41f44fc025d2d042da95e9d8ea1f (diff) | |
download | rails-f9da785d0b1b22317cfca25c15fb555e9016accb.tar.gz rails-f9da785d0b1b22317cfca25c15fb555e9016accb.tar.bz2 rails-f9da785d0b1b22317cfca25c15fb555e9016accb.zip |
Move background jobs to the 'jobs' branch until fully baked. Not shipping with Rails 4.0.
Diffstat (limited to 'railties/lib')
6 files changed, 2 insertions, 47 deletions
diff --git a/railties/lib/rails.rb b/railties/lib/rails.rb index ac8e84e366..bb98bbe5bf 100644 --- a/railties/lib/rails.rb +++ b/railties/lib/rails.rb @@ -32,25 +32,6 @@ module Rails application.config end - # Rails.queue is the application's queue. You can push a job onto - # the queue by: - # - # Rails.queue.push job - # - # A job is an object that responds to +run+. Queue consumers will - # pop jobs off of the queue and invoke the queue's +run+ method. - # - # Note that depending on your queue implementation, jobs may not - # be executed in the same process as they were created in, and - # are never executed in the same thread as they were created in. - # - # If necessary, a queue implementation may need to serialize your - # job for distribution to another process. The documentation of - # your queue will specify the requirements for that serialization. - def queue - application.queue - end - def initialize! application.initialize! end diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index bf3a26d400..9d71bf448d 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -1,5 +1,4 @@ require 'fileutils' -require 'active_support/queueing' # FIXME remove DummyKeyGenerator and this require in 4.1 require 'active_support/key_generator' require 'rails/engine' @@ -68,10 +67,9 @@ module Rails end end - attr_accessor :assets, :sandbox, :queue_consumer + attr_accessor :assets, :sandbox alias_method :sandbox?, :sandbox attr_reader :reloaders - attr_writer :queue delegate :default_url_options, :default_url_options=, to: :routes @@ -83,7 +81,6 @@ module Rails @env_config = nil @ordered_railties = nil @railties = nil - @queue = nil end # Returns true if the application is initialized. @@ -228,10 +225,6 @@ module Rails @config ||= Application::Configuration.new(find_root_with_flag("config.ru", Dir.pwd)) end - def queue #:nodoc: - @queue ||= config.queue || ActiveSupport::Queue.new - end - def to_app #:nodoc: self end diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index f15fc9296d..086fd5ed95 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -1,6 +1,5 @@ require 'active_support/core_ext/kernel/reporting' require 'active_support/file_update_checker' -require 'active_support/queueing' require 'rails/engine/configuration' module Rails @@ -13,7 +12,7 @@ module Rails :railties_order, :relative_url_root, :secret_key_base, :secret_token, :serve_static_assets, :ssl_options, :static_cache_control, :session_options, :time_zone, :reload_classes_only_on_change, - :queue, :queue_consumer, :beginning_of_week, :filter_redirect + :beginning_of_week, :filter_redirect attr_writer :log_level attr_reader :encoding @@ -44,8 +43,6 @@ module Rails @exceptions_app = nil @autoflush_log = true @log_formatter = ActiveSupport::Logger::SimpleFormatter.new - @queue = ActiveSupport::SynchronousQueue.new - @queue_consumer = nil @eager_load = nil @secret_token = nil @secret_key_base = nil diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb index 09902ad597..872d78d9a4 100644 --- a/railties/lib/rails/application/finisher.rb +++ b/railties/lib/rails/application/finisher.rb @@ -96,15 +96,6 @@ module Rails ActiveSupport::Dependencies.unhook! end end - - initializer :activate_queue_consumer do |app| - if config.queue.class == ActiveSupport::Queue - app.queue_consumer = config.queue_consumer || config.queue.consumer - app.queue_consumer.logger ||= Rails.logger if app.queue_consumer.respond_to?(:logger=) - app.queue_consumer.start - at_exit { app.queue_consumer.shutdown } - end - end end end end diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt index 593d2acfc7..68df1d1ec8 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt @@ -84,8 +84,4 @@ # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new - - # Default the production mode queue to an synchronous queue. You will probably - # want to replace this with an out-of-process queueing solution. - # config.queue = ActiveSupport::SynchronousQueue.new end diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt index a5ef0cd9cd..3c9c787948 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt @@ -33,7 +33,4 @@ # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr - - # Use the synchronous queue to run jobs immediately. - config.queue = ActiveSupport::SynchronousQueue.new end |