Class: Keymap::ConnectionAdapters::ConnectionManagement

Inherits:
Object
  • Object
show all
Defined in:
lib/keymap/connection_adapters/abstract/connection_pool.rb

Defined Under Namespace

Classes: Proxy

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ ConnectionManagement

Returns a new instance of ConnectionManagement.



418
419
420
# File 'lib/keymap/connection_adapters/abstract/connection_pool.rb', line 418

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



422
423
424
425
426
427
428
429
430
431
# File 'lib/keymap/connection_adapters/abstract/connection_pool.rb', line 422

def call(env)
  testing = env.key?('rack.test')

  status, headers, body = @app.call(env)

  [status, headers, Proxy.new(body, testing)]
rescue
  Keymap::Base.clear_active_connections! unless testing
  raise
end