class Concurrent::Edge::CompletableFuture

A Future which can be completed by user.

Public Instance Methods

complete(success, value, reason, raise_on_reassign = true) click to toggle source

Complete the future with triplet od `success`, `value`, `reason` `raise` if already completed return [self]

# File lib/concurrent/edge/future.rb, line 836
def complete(success, value, reason, raise_on_reassign = true)
  complete_with(success ? Success.new(value) : Failed.new(reason), raise_on_reassign)
end
evaluate_to(*args, &block) click to toggle source

Evaluate the future to value if there is an exception the future fails with it return [self]

# File lib/concurrent/edge/future.rb, line 866
def evaluate_to(*args, &block)
  promise.evaluate_to(*args, block)
end
evaluate_to!(*args, &block) click to toggle source

Evaluate the future to value if there is an exception the future fails with it @raise the exception return [self]

# File lib/concurrent/edge/future.rb, line 873
def evaluate_to!(*args, &block)
  promise.evaluate_to!(*args, block)
end
fail(reason = StandardError.new) click to toggle source

Fail the future with reason return [self]

# File lib/concurrent/edge/future.rb, line 854
def fail(reason = StandardError.new)
  promise.fail(reason)
end
hide_completable() click to toggle source
# File lib/concurrent/edge/future.rb, line 877
def hide_completable
  FutureWrapperPromise.new(self, @DefaultExecutor).future
end
success(value) click to toggle source

Complete the future with value return [self]

# File lib/concurrent/edge/future.rb, line 842
def success(value)
  promise.success(value)
end
try_fail(reason = StandardError.new) click to toggle source

Try to fail the future with reason return [self]

# File lib/concurrent/edge/future.rb, line 860
def try_fail(reason = StandardError.new)
  promise.try_fail(reason)
end
try_success(value) click to toggle source

Try to complete the future with value return [self]

# File lib/concurrent/edge/future.rb, line 848
def try_success(value)
  promise.try_success(value)
end