Class: Concurrent::Promises::ResolvableEvent
- Inherits:
-
Event
- Object
- Synchronization::Object
- AbstractEventFuture
- Event
- Concurrent::Promises::ResolvableEvent
- Includes:
- Resolvable
- Defined in:
- lib/concurrent/promises.rb
Overview
A Event which can be resolved by user.
Instance Method Summary collapse
-
#resolve(raise_on_reassign = true) ⇒ self, false
Makes the event resolved, which triggers all dependent futures.
-
#with_hidden_resolvable ⇒ Event
Creates new event wrapping receiver, effectively hiding the resolve method.
Methods inherited from Event
#any, #delay, #schedule, #to_event, #to_future, #with_default_executor, #zip
Methods inherited from AbstractEventFuture
#chain, #chain_on, #chain_resolvable, #default_executor, #on_resolution, #on_resolution!, #on_resolution_using, #pending?, #resolved?, #state, #to_s, #touch, #wait, #with_default_executor
Methods inherited from Synchronization::Object
attr_atomic, attr_volatile, ensure_safe_initialization_when_final_fields_are_present, #initialize, new, safe_initialization!, safe_initialization?, volatile_cas_fields
Instance Method Details
#resolve(raise_on_reassign = true) ⇒ self, false
Makes the event resolved, which triggers all dependent futures.
1230 1231 1232 |
# File 'lib/concurrent/promises.rb', line 1230 def resolve(raise_on_reassign = true) resolve_with RESOLVED, raise_on_reassign end |
#with_hidden_resolvable ⇒ Event
Creates new event wrapping receiver, effectively hiding the resolve method.
1237 1238 1239 |
# File 'lib/concurrent/promises.rb', line 1237 def with_hidden_resolvable @with_hidden_resolvable ||= EventWrapperPromise.new_blocked_by1(self, @DefaultExecutor).event end |