Sha256: 2c3e00bf2ceac7b41998350acc2c73760891946b0cac268571d743958998f2f1
Contents?: true
Size: 1.14 KB
Versions: 95
Compression:
Stored size: 1.14 KB
Contents
require 'typhoeus' module Acfs module Adapter # Adapter for Typhoeus. # class Typhoeus < Base def start hydra.run end def abort hydra.abort end def run(request) convert_request(request).run end def queue(request) hydra.queue convert_request request end protected def hydra @hydra ||= ::Typhoeus::Hydra.new end def convert_request(req) request = ::Typhoeus::Request.new req.url, method: req.method, params: req.params, headers: req.headers, body: req.body request.on_complete do |response| req.complete! convert_response(req, response) end request end def convert_response(request, response) Acfs::Response.new request, status: response.code, headers: response.headers, body: response.body end end end end
Version data entries
95 entries across 95 versions & 1 rubygems