diff options
author | Azul <azul@riseup.net> | 2016-06-30 11:23:45 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2016-06-30 12:04:07 +0200 |
commit | 0491e79c4e5f16d38cf87e53290394e1eccfa2e9 (patch) | |
tree | 56d0aff1fc8ca1bbd11b09bc6929f00132467898 /lib/nickserver/adapters/em_http.rb | |
parent | 4132d6e6db3755334ace352165991487802c6b82 (diff) |
Trying to replace EM base server with reel
some tests are still broken. But at least they are running now.
Diffstat (limited to 'lib/nickserver/adapters/em_http.rb')
-rw-r--r-- | lib/nickserver/adapters/em_http.rb | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/nickserver/adapters/em_http.rb b/lib/nickserver/adapters/em_http.rb deleted file mode 100644 index 16db5ae..0000000 --- a/lib/nickserver/adapters/em_http.rb +++ /dev/null @@ -1,24 +0,0 @@ -require 'nickserver/adapters' -require 'em-http' - -module Nickserver::Adapters - class EmHttp - - def initialize - @timeout = 5 - end - - def get(url, options = {}) - get_request(url, options).callback {|http| - yield http.response_header.status, http.response - }.errback {|http| - yield 0, http.error - } - end - - def get_request(url, options = {}) - @request = EventMachine::HttpRequest.new(url) - @request.get timeout: @timeout, query: options[:query] - end - end -end |