lib/hirefire/middleware.rb
def call(env)
      handle_queue(env["HTTP_X_REQUEST_START"])

      if test_path?(env["PATH_INFO"])
        build_test_response
      elsif info_path?(env["PATH_INFO"])
        build_info_response
      else
        @app.call(env)
      end
    end
def call(env)
      handle_queue(env["HTTP_X_REQUEST_START"])

      if test_path?(env["PATH_INFO"])
        build_test_response
      elsif info_path?(env["PATH_INFO"])
        build_info_response
      else
        @app.call(env)
      end
    end
Initializes HireFire::Middleware.

 @param [Proc] app call with `env` to continue down the middleware stack.

 Intercepts and handles the /hirefire/test, /hirefire/development/info,
 and /hirefire/HIREFIRE_TOKEN/info paths. If none of these paths match,
 then then request will continue down the middleware stack.

 When HireFire::Resource.log_queue_metrics is enabled, and the HTTP_X_REQUEST_START
 header has been injected at the Heroku Router layer, queue time information will be
 logged to STDOUT. This data can be used by the HireFire Logdrain with the
 Web.Logplex.QueueTime autoscaling strategy.

 Important: Don't set/update instance variables within this- or any underlying methods.
 Doing so may result in race conditions when using threaded application servers.

 @param [Hash] env containing request information.