Skip to content

Commit 0f4ea95

Browse files
committed
Reason can actually be any object
1 parent f803dda commit 0f4ea95

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/concurrent/promises.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def future_on(default_executor, *args, &task)
110110
#
111111
# @param [true, false] fulfilled
112112
# @param [Object] value
113-
# @param [Exception] reason
113+
# @param [Object] reason
114114
# @!macro promises.param.default_executor
115115
# @return [Future]
116116
def resolved_future(fulfilled, value, reason, default_executor = self.default_executor)
@@ -129,7 +129,7 @@ def fulfilled_future(value, default_executor = self.default_executor)
129129
# Creates resolved future with will be rejected with the given reason.
130130
#
131131
# @!macro promises.param.default_executor
132-
# @param [Exception] reason
132+
# @param [Object] reason
133133
# @return [Future]
134134
def rejected_future(reason, default_executor = self.default_executor)
135135
resolved_future false, nil, reason, default_executor
@@ -623,7 +623,7 @@ def chain(*args, &task)
623623
# @yield [fulfilled, value, reason, *args] to the task.
624624
# @yieldparam [true, false] fulfilled
625625
# @yieldparam [Object] value
626-
# @yieldparam [Exception] reason
626+
# @yieldparam [Object] reason
627627
def chain_on(executor, *args, &task)
628628
ChainPromise.new_blocked_by1(self, @DefaultExecutor, executor, args, &task).future
629629
end
@@ -664,7 +664,7 @@ def on_resolution(*args, &callback)
664664
# @yield [fulfilled, value, reason, *args] to the callback.
665665
# @yieldparam [true, false] fulfilled
666666
# @yieldparam [Object] value
667-
# @yieldparam [Exception] reason
667+
# @yieldparam [Object] reason
668668
def on_resolution!(*args, &callback)
669669
add_callback :callback_on_resolution, args, callback
670670
end
@@ -682,7 +682,7 @@ def on_resolution!(*args, &callback)
682682
# @yield [fulfilled, value, reason, *args] to the callback.
683683
# @yieldparam [true, false] fulfilled
684684
# @yieldparam [Object] value
685-
# @yieldparam [Exception] reason
685+
# @yieldparam [Object] reason
686686
def on_resolution_using(executor, *args, &callback)
687687
add_callback :async_callback_on_resolution, executor, args, callback
688688
end
@@ -966,7 +966,7 @@ def value(timeout = nil, timeout_value = nil)
966966
# @!macro promises.warn.nil
967967
# @!macro promises.param.timeout
968968
# @!macro promises.param.timeout_value
969-
# @return [Exception, timeout_value] the reason, or timeout_value on timeout, or nil on fulfillment.
969+
# @return [Object, timeout_value] the reason, or timeout_value on timeout, or nil on fulfillment.
970970
def reason(timeout = nil, timeout_value = nil)
971971
if wait_until_resolved timeout
972972
internal_state.reason
@@ -980,7 +980,7 @@ def reason(timeout = nil, timeout_value = nil)
980980
#
981981
# @!macro promises.warn.blocks
982982
# @!macro promises.param.timeout
983-
# @return [Array(Boolean, Object, Exception), nil] triplet of fulfilled?, value, reason, or nil
983+
# @return [Array(Boolean, Object, Object), nil] triplet of fulfilled?, value, reason, or nil
984984
# on timeout.
985985
def result(timeout = nil)
986986
internal_state.result if wait_until_resolved timeout
@@ -1423,7 +1423,7 @@ class ResolvableFuture < Future
14231423
#
14241424
# @param [true, false] fulfilled
14251425
# @param [Object] value
1426-
# @param [Exception] reason
1426+
# @param [Object] reason
14271427
# @!macro promise.param.raise_on_reassign
14281428
# @!macro promise.param.reserved
14291429
def resolve(fulfilled = true, value = nil, reason = nil, raise_on_reassign = true, reserved = false)
@@ -1443,7 +1443,7 @@ def fulfill(value, raise_on_reassign = true, reserved = false)
14431443
# Makes the future rejected with `reason`,
14441444
# which triggers all dependent futures.
14451445
#
1446-
# @param [Exception] reason
1446+
# @param [Object] reason
14471447
# @!macro promise.param.raise_on_reassign
14481448
# @!macro promise.param.reserved
14491449
def reject(reason, raise_on_reassign = true, reserved = false)

0 commit comments

Comments
 (0)