123456789_123456789_123456789_123456789_123456789_

Class: ActionDispatch::Executor

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Inherits: Object
Defined in: actionpack/lib/action_dispatch/middleware/executor.rb

Class Method Summary

Instance Method Summary

Constructor Details

.new(app, executor) ⇒ Executor

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/middleware/executor.rb', line 7

def initialize(app, executor)
  @app, @executor = app, executor
end

Instance Method Details

#call(env)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/middleware/executor.rb', line 11

def call(env)
  state = @executor.run!(reset: true)
  begin
    response = @app.call(env)
    returned = response << ::Rack::BodyProxy.new(response.pop) { state.complete! }
  ensure
    state.complete! unless returned
  end
end