123456789_123456789_123456789_123456789_123456789_

Class: Concurrent::Promises::ZipFutureEventPromise

Constant Summary

InternalStates - Included

PENDING, RESERVED, RESOLVED

Class Attribute Summary

Class Method Summary

BlockedPromise - Inherited

AbstractPromise - Inherited

Synchronization::Object - Inherited

.atomic_attribute?, .atomic_attributes,
.attr_atomic

Creates methods for reading and writing to a instance variable with volatile (Java) semantic as .attr_volatile does.

.attr_volatile

Creates methods for reading and writing (as attr_accessor does) to a instance variable with volatile (Java) semantic.

.ensure_safe_initialization_when_final_fields_are_present

For testing purposes, quite slow.

.new

Has to be called by children.

.safe_initialization!, .define_initialize_atomic_fields

Synchronization::AbstractObject - Inherited

Instance Method Summary

Constructor Details

.new(delayed, blockers_count, default_executor) ⇒ ZipFutureEventPromise

[ GitHub ]

  
# File 'lib/concurrent-ruby/concurrent/promises.rb', line 1953

def initialize(delayed, blockers_count, default_executor)
  super delayed, 2, Future.new(self, default_executor)
  @result = nil
end

Instance Method Details

#on_resolvable(resolved_future, index) (private)

[ GitHub ]

  
# File 'lib/concurrent-ruby/concurrent/promises.rb', line 1967

def on_resolvable(resolved_future, index)
  resolve_with @result
end

#process_on_blocker_resolution(future, index) (private)

[ GitHub ]

  
# File 'lib/concurrent-ruby/concurrent/promises.rb', line 1960

def process_on_blocker_resolution(future, index)
  # first blocking is future, take its result
  @result = future.internal_state if index == 0
  # super has to be called after above to piggyback on volatile @Countdown
  super future, index
end