class Typhoid::RequestQueue

Attributes

queue[R]
target[RW]

Public Class Methods

new(target, hydra = nil) click to toggle source
# File lib/typhoid/request_queue.rb, line 8
def initialize(target, hydra = nil)
  @target = target
  @hydra = hydra || Typhoeus::Hydra.new
end

Public Instance Methods

requests() click to toggle source
# File lib/typhoid/request_queue.rb, line 25
def requests
  @queue ||= []
end
resource(name, req, &block) click to toggle source
# File lib/typhoid/request_queue.rb, line 13
def resource(name, req, &block)
  @queue ||= []
  @queue << QueuedRequest.new(@hydra, name, req, @target)
  #@queue[name].on_complete &block if block != nil
end
resource_with_target(name, req, target, &block) click to toggle source
# File lib/typhoid/request_queue.rb, line 19
def resource_with_target(name, req, target, &block)
  @queue ||= []
  @queue << QueuedRequest.new(@hydra, name, req, target)
  #@queue[name].on_complete &block if block != nil
end
run() click to toggle source
# File lib/typhoid/request_queue.rb, line 29
def run
  @hydra.run
end