Class: DripDrop::HTTPEMServer
- Inherits:
-
EM::Connection
- Object
- EM::Connection
- DripDrop::HTTPEMServer
- Includes:
- EM::HttpServer
- Defined in:
- lib/dripdrop/handlers/http.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.
22 23 24 |
# File 'lib/dripdrop/handlers/http.rb', line 22 def initialize(dd_handler) @dd_handler = dd_handler end |
Instance Method Details
#post_init ⇒ Object
26 27 28 29 |
# File 'lib/dripdrop/handlers/http.rb', line 26 def post_init super no_environment_strings end |
#process_http_request ⇒ Object
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/dripdrop/handlers/http.rb', line 31 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 |