Class: Autoscale::Agent::Middleware

Inherits:
Object
  • Object
show all
Defined in:
lib/autoscale/agent/middleware.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Middleware

Returns a new instance of Middleware.



6
7
8
# File 'lib/autoscale/agent/middleware.rb', line 6

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



10
11
12
13
14
# File 'lib/autoscale/agent/middleware.rb', line 10

def call(env)
  return serve(env) if env["PATH_INFO"] == "/autoscale"
  record_queue_time(env)
  @app.call(env)
end