Class: WebFetch::Server
- Inherits:
-
EM::Connection
- Object
- EM::Connection
- WebFetch::Server
- Includes:
- EM::HttpServer, HTTPHelpers
- Defined in:
- lib/web_fetch/server.rb
Overview
Web server that accepts requests to gather and retrieve external HTTP requests
Instance Attribute Summary collapse
-
#storage ⇒ Object
readonly
Returns the value of attribute storage.
Instance Method Summary collapse
Methods included from HTTPHelpers
#accept_gzip?, #compress, #default_headers, #fail_, #pending, #post_data, #request_params, #respond_immediately, #succeed
Instance Attribute Details
#storage ⇒ Object (readonly)
Returns the value of attribute storage.
7 8 9 |
# File 'lib/web_fetch/server.rb', line 7 def storage @storage end |
Instance Method Details
#post_init ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/web_fetch/server.rb', line 12 def post_init super @router = Router.new @storage = WebFetch::Storage.create no_environment_strings end |
#process_http_request ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/web_fetch/server.rb', line 20 def process_http_request resource = @router.route(@http_request_uri, request_params) response = EM::DelegatedHttpResponse.new(self) default_headers(response) outcome(resource, response) end |