Class: DripDrop::HTTPEMServer
- Inherits:
-
EM::Connection
- Object
- EM::Connection
- DripDrop::HTTPEMServer
- Includes:
- EM::HttpServer
- Defined in:
- lib/dripdrop/handlers/http_server.rb
Instance Method Summary collapse
-
#initialize(dd_handler) ⇒ HTTPEMServer
constructor
A new instance of HTTPEMServer.
- #post_init ⇒ Object
- #process_http_request ⇒ Object
Constructor Details
#initialize(dd_handler) ⇒ HTTPEMServer
Returns a new instance of HTTPEMServer.
21 22 23 |
# File 'lib/dripdrop/handlers/http_server.rb', line 21 def initialize(dd_handler) @dd_handler = dd_handler end |
Instance Method Details
#post_init ⇒ Object
25 26 27 28 |
# File 'lib/dripdrop/handlers/http_server.rb', line 25 def post_init super no_environment_strings end |
#process_http_request ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/dripdrop/handlers/http_server.rb', line 30 def process_http_request begin = @dd_handler..decode_json(@http_post_content) response = EM::DelegatedHttpResponse.new(self) dd_response = HTTPServerHandlerResponse.new(response) @dd_handler.recv_cbak.call(, dd_response) if @dd_handler.recv_cbak rescue StandardError => e handler_error(e) end end |