123456789_123456789_123456789_123456789_123456789_

Class: Concurrent::Promises::DelayPromise

Constant Summary

InternalStates - Included

PENDING, RESERVED, RESOLVED

Class Attribute Summary

Class Method Summary

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(default_executor) ⇒ DelayPromise

[ GitHub ]

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

def initialize(default_executor)
  event    = Event.new(self, default_executor)
  @Delayed = LockFreeStack.of1(self)
  super event
  event.add_callback_clear_delayed_node @Delayed.peek
end

Instance Method Details

#delayed_because

[ GitHub ]

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

def delayed_because
  @Delayed
end

#touch

[ GitHub ]

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

def touch
  @Future.resolve_with RESOLVED
end