From 6e319ccce27d0855025eb69cb5224bd81cb41601 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 4 Jul 2005 19:06:50 +0000 Subject: Added an EXPERIMENTAL gateway.cgi for getting high-speed performance through vanilla CGI using a long-running, DRb-backed server in the background (using script/listener and script/tracker) #1603 [Nicholas Seckar] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1674 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/CHANGELOG | 2 ++ railties/Rakefile | 5 ++++- railties/lib/fcgi_handler.rb | 7 ++++--- .../rails_generator/generators/applications/app/app_generator.rb | 3 ++- 4 files changed, 12 insertions(+), 5 deletions(-) (limited to 'railties') diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 16c7cdd5e3..17505f12bf 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Added an EXPERIMENTAL gateway.cgi for getting high-speed performance through vanilla CGI using a long-running, DRb-backed server in the background (using script/listener and script/tracker) #1603 [Nicholas Seckar] + * Added migration generator: ./script/generate migration add_system_settings * Added "migrate" as rake task to execute all the pending migrations from db/migrate diff --git a/railties/Rakefile b/railties/Rakefile index 28cc23d84b..dc2b7a80f8 100644 --- a/railties/Rakefile +++ b/railties/Rakefile @@ -26,7 +26,7 @@ TEST_DIRS = %w( fixtures unit functional mocks mocks/development mocks/test ) LOG_FILES = %w( server.log development.log test.log production.log ) HTML_FILES = %w( 404.html 500.html index.html favicon.ico javascripts/prototype.js javascripts/effects.js javascripts/dragdrop.js javascripts/controls.js ) -BIN_FILES = %w( generate destroy breakpointer console server update runner profiler benchmarker ) +BIN_FILES = %w( generate destroy breakpointer console server update runner profiler benchmarker listener tracker ) VENDOR_LIBS = %w( actionpack activerecord actionmailer activesupport actionwebservice railties ) @@ -135,6 +135,9 @@ task :copy_dispatches do copy_with_rewritten_ruby_path("dispatches/dispatch.fcgi", "#{PKG_DESTINATION}/public/dispatch.fcgi") chmod 0755, "#{PKG_DESTINATION}/public/dispatch.fcgi" + + copy_with_rewritten_ruby_path("dispatches/gateway.cgi", "#{PKG_DESTINATION}/public/gateway.cgi") + chmod 0644, "#{PKG_DESTINATION}/public/gateway.cgi" end task :copy_html_files do diff --git a/railties/lib/fcgi_handler.rb b/railties/lib/fcgi_handler.rb index f489627985..f2455b01c9 100644 --- a/railties/lib/fcgi_handler.rb +++ b/railties/lib/fcgi_handler.rb @@ -45,14 +45,14 @@ class RailsFCGIHandler dispatcher_log(:info, "starting") end - def process! + def process!(provider = FCGI) # Make a note of $" so we can safely reload this instance. mark! # Begin countdown to garbage collection. run_gc! if gc_request_period - FCGI.each_cgi do |cgi| + provider.each_cgi do |cgi| # Safely reload this instance if requested. if when_ready == :reload run_gc! if gc_request_period @@ -90,7 +90,8 @@ class RailsFCGIHandler dispatcher_error(fcgi_error, "killed by this error") end end - + + private def logger @logger ||= Logger.new(@log_file_path) diff --git a/railties/lib/rails_generator/generators/applications/app/app_generator.rb b/railties/lib/rails_generator/generators/applications/app/app_generator.rb index facde24183..88089f5d16 100644 --- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb +++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb @@ -43,7 +43,7 @@ class AppGenerator < Rails::Generator::Base m.file "environments/test.rb", "config/environments/test.rb" # Scripts - %w(console destroy generate server runner benchmarker profiler).each do |file| + %w(console destroy generate server runner benchmarker profiler tracker listener).each do |file| m.file "bin/#{file}", "script/#{file}", script_options end if options[:gem] @@ -56,6 +56,7 @@ class AppGenerator < Rails::Generator::Base m.file "dispatches/dispatch.rb", "public/dispatch.rb", script_options m.file "dispatches/dispatch.rb", "public/dispatch.cgi", script_options m.file "dispatches/dispatch.fcgi", "public/dispatch.fcgi", script_options + m.file "dispatches/gateway.cgi", "public/gateway.cgi", script_options # HTML files %w(404 500 index).each do |file| -- cgit v1.2.3