class IOPromise::Faraday::FaradayPromise

Public Class Methods

new(response = nil) click to toggle source
Calls superclass method
# File lib/iopromise/faraday/promise.rb, line 13
def initialize(response = nil)
  super()
    
  @response = response
  @started = false

  unless @response.nil?
    @response.on_complete do |response_env|
      fulfill(@response)
    end
  end
    
  ::IOPromise::ExecutorContext.current.register(self) unless @response.nil?
end
parallel_manager() click to toggle source
# File lib/iopromise/faraday/promise.rb, line 9
def self.parallel_manager
  ContinuableHydra.for_current_thread
end

Public Instance Methods

execute_pool() click to toggle source
# File lib/iopromise/faraday/promise.rb, line 36
def execute_pool
  FaradayExecutorPool.for(Thread.current)
end
wait() click to toggle source
Calls superclass method
# File lib/iopromise/faraday/promise.rb, line 28
def wait
  if @response.nil?
    super
  else
    ::IOPromise::ExecutorContext.current.wait_for_all_data(end_when_complete: self)
  end
end