class AWS::Core::Http::CurbHandler

@private

Public Class Methods

new() click to toggle source
# File lib/aws/core/http/curb_handler.rb, line 23
def initialize
  @q = []
  @sem = Mutex.new
  @multi = Curl::Multi.new

  start_processor
end

Public Instance Methods

handle(request, response) click to toggle source
# File lib/aws/core/http/curb_handler.rb, line 31
def handle request, response
  raise "unsupport http reqest method: #{request.http_method}" unless
    ['GET', 'HEAD', 'PUT', 'POST', 'DELETE'].include? request.http_method
  @sem.synchronize do
    @q << [request, response, Thread.current]
    begin
     @processor.wakeup
    rescue ThreadError
      start_processor
    end
  end
  Thread.stop
  nil
end