class Concurrent::Edge::ZipFutureFuturePromise

@!visibility private

Public Class Methods

new(future1, future2, default_executor) click to toggle source
Calls superclass method Concurrent::Edge::BlockedPromise.new
# File lib/concurrent/edge/future.rb, line 1244
def initialize(future1, future2, default_executor)
  super Future.new(self, default_executor), [future1, future2], 2
  @Future1Result = future1
  @Future2Result = future2
end

Public Instance Methods

on_completable(done_future) click to toggle source
# File lib/concurrent/edge/future.rb, line 1250
def on_completable(done_future)
  success1, value1, reason1 = @Future1Result.result
  success2, value2, reason2 = @Future2Result.result
  success                   = success1 && success2
  new_state                 = if success
                                Future::SuccessArray.new([value1, value2])
                              else
                                Future::PartiallyFailed.new([value1, value2], [reason1, reason2])
                              end
  complete_with new_state
end