Class: Cannon::Handler

Inherits:
EventMachine::Connection
  • Object
show all
Includes:
EventMachine::HttpServer
Defined in:
lib/cannon/handler.rb

Instance Method Summary collapse

Instance Method Details

#appObject



5
6
7
8
# File 'lib/cannon/handler.rb', line 5

def app
  # magically defined by Cannon::App
  self.class.app
end

#process_http_requestObject



10
11
12
13
14
15
16
17
# File 'lib/cannon/handler.rb', line 10

def process_http_request
  request = Request.new(self, app)
  response = Response.new(self, app)

  app.reload_environment if app.config.reload_on_request

  app.middleware_runner.run(request, response) if middleware?
end