Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8488

Show
Ignore:
Timestamp:
12/27/07 11:17:05 (6 months ago)
Author:
bitsweat
Message:

Introduce native mongrel handler and push mutex into dispatcher.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/dispatcher.rb

    r8346 r8488  
    33  # reloading the app after each request when Dependencies.load? is true. 
    44  class Dispatcher 
     5    @@guard = Mutex.new 
     6 
    57    class << self 
    68      # Backward-compatible class method takes CGI-specific args. Deprecated 
     
    112114 
    113115    def dispatch 
    114       run_callbacks :before 
    115       handle_request 
    116     rescue Exception => exception 
    117       failsafe_rescue exception 
    118     ensure 
    119       run_callbacks :after, :reverse_each 
     116      @@guard.synchronize do 
     117        begin 
     118          run_callbacks :before 
     119          handle_request 
     120        rescue Exception => exception 
     121          failsafe_rescue exception 
     122        ensure 
     123          run_callbacks :after, :reverse_each 
     124        end 
     125      end 
    120126    end 
    121127 
  • trunk/railties/CHANGELOG

    r8435 r8488  
    11*SVN* 
     2 
     3* Introduce native mongrel handler and push mutex into dispatcher.  [Jeremy Kemper] 
    24 
    35* Ruby 1.9 compatibility.  #1689, #10546 [Cheah Chu Yeow, frederico] 
  • trunk/railties/lib/commands/server.rb

    r6344 r8488  
    1919  else 
    2020    if defined?(Mongrel) 
    21       "mongrel" 
     21      if Mongrel.respond_to?(:log) 
     22        "new_mongrel" 
     23      else 
     24        "mongrel" 
     25      end 
    2226    elsif RUBY_PLATFORM !~ /(:?mswin|mingw)/ && !silence_stderr { `lighttpd -version` }.blank? && defined?(FCGI) 
    2327      "lighttpd" 
     
    3236  when "lighttpd" 
    3337    puts "=> Booting lighttpd (use 'script/server webrick' to force WEBrick)" 
    34   when "mongrel" 
     38  when "mongrel", "new_mongrel" 
    3539    puts "=> Booting Mongrel (use 'script/server webrick' to force WEBrick)" 
    3640end