Class: Concurrent::Promises::AbstractPromise Abstract Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
AbstractAnyPromise, AbstractFlatPromise, AnyFulfilledFuturePromise, AnyResolvedEventPromise, AnyResolvedFuturePromise, BlockedPromise, BlockedTaskPromise, ChainPromise, DelayPromise, EventWrapperPromise, FlatEventPromise, FlatFuturePromise, FutureWrapperPromise, ImmediateEventPromise, ImmediateFuturePromise, InnerPromise, RescuePromise, ResolvableEventPromise, ResolvableFuturePromise, RunFuturePromise, ScheduledPromise, ThenPromise, ZipEventEventPromise, ZipEventsPromise, ZipFutureEventPromise, ZipFuturesPromise
|
|
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
Concurrent::Synchronization::Object
|
Defined in: | lib/concurrent-ruby/concurrent/promises.rb |
Overview
This class is abstract.
Constant Summary
InternalStates
- Included
Class Attribute Summary
Synchronization::Object
- Inherited
Class Method Summary
- .new(future) ⇒ AbstractPromise constructor Internal use only
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 | Creates methods for reading and writing (as |
.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
- #default_executor Internal use only
- #delayed_because Internal use only
-
#event
Alias for #future.
- #future (also: #event) Internal use only
-
#inspect
Alias for #to_s.
- #state Internal use only
- #to_s (also: #inspect) Internal use only
- #touch Internal use only
- #evaluate_to(*args, block) ⇒ Future private Internal use only
- #resolve_with(new_state, raise_on_reassign = true) private Internal use only
Synchronization::Object
- Inherited
Synchronization::Volatile
- Included
Synchronization::AbstractObject
- Inherited
Constructor Details
.new(future) ⇒ AbstractPromise
# File 'lib/concurrent-ruby/concurrent/promises.rb', line 1553
def initialize(future) super() @Future = future end
Instance Method Details
#default_executor
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/promises.rb', line 1564
def default_executor future.default_executor end
#delayed_because
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/promises.rb', line 1581
def delayed_because nil end
#evaluate_to(*args, block) ⇒ Future (private)
# File 'lib/concurrent-ruby/concurrent/promises.rb', line 1592
def evaluate_to(*args, block) resolve_with Fulfilled.new(block.call(*args)) rescue Exception => error resolve_with Rejected.new(error) raise error unless error.is_a?(StandardError) end
#event
Alias for #future.
# File 'lib/concurrent-ruby/concurrent/promises.rb', line 1562
alias_method :event, :future
#future Also known as: #event
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/promises.rb', line 1558
def future @Future end
#inspect
Alias for #to_s.
# File 'lib/concurrent-ruby/concurrent/promises.rb', line 1579
alias_method :inspect, :to_s
#resolve_with(new_state, raise_on_reassign = true) (private)
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/promises.rb', line 1587
def resolve_with(new_state, raise_on_reassign = true) @Future.resolve_with(new_state, raise_on_reassign) end
#state
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/promises.rb', line 1568
def state future.state end
#to_s Also known as: #inspect
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/promises.rb', line 1575
def to_s format '%s %s>', super[0..-2], @Future end
#touch
[ GitHub ]# File 'lib/concurrent-ruby/concurrent/promises.rb', line 1572
def touch end