@!visibility private
# File lib/concurrent/edge/future.rb, line 944 def initialize(default_executor) super CompletableFuture.new(self, default_executor) end
@return [Future]
# File lib/concurrent/edge/future.rb, line 977 def evaluate_to!(*args, block) evaluate_to(*args, block).wait! end
Set the `Future` to failed due to some error and wake or notify all threads waiting on it.
@param [Object] reason for the failure @raise [Concurrent::MultipleAssignmentError] if the `Future` has already been set or otherwise completed @return [Future]
# File lib/concurrent/edge/future.rb, line 966 def fail(reason = StandardError.new) complete_with Future::Failed.new(reason) end
Set the `Future` to a value and wake or notify all threads waiting on it.
@param [Object] value the value to store in the `Future` @raise [Concurrent::MultipleAssignmentError] if the `Future` has already been set or otherwise completed @return [Future]
# File lib/concurrent/edge/future.rb, line 953 def success(value) complete_with Future::Success.new(value) end
# File lib/concurrent/edge/future.rb, line 970 def try_fail(reason = StandardError.new) !!complete_with(Future::Failed.new(reason), false) end
# File lib/concurrent/edge/future.rb, line 957 def try_success(value) !!complete_with(Future::Success.new(value), false) end