class Concurrent::Promises::RunFuturePromise

Public Class Methods

new(delayed, blockers_count, default_executor) click to toggle source
# File lib/concurrent/promises.rb, line 1673
def initialize(delayed, blockers_count, default_executor)
  super delayed, 1, Future.new(self, default_executor)
end

Private Instance Methods

process_on_blocker_resolution(future, index) click to toggle source
# File lib/concurrent/promises.rb, line 1677
def process_on_blocker_resolution(future, index)
  internal_state = future.internal_state

  unless internal_state.fulfilled?
    resolve_with internal_state
    return 0
  end

  value = internal_state.value
  case value
  when Future
    add_delayed_of value
    value.add_callback_notify_blocked self, nil
  else
    resolve_with internal_state
  end

  1
end