summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-12-26 22:09:49 +1300
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2021-03-30 18:38:42 +1300
commit511acba4aeb3e35cf025a8a6cde4241b7b5167f3 (patch)
tree9944f9cea1fd42e9dc6780bf9ed9dfd6d3090757 /doc
parent09c865d541472366550804ef09bf14e22a193644 (diff)
Update method name and add documentation.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4173
Diffstat (limited to 'doc')
-rw-r--r--doc/fiber.md12
1 files changed, 11 insertions, 1 deletions
diff --git a/doc/fiber.md b/doc/fiber.md
index 5abd848677..840bebd188 100644
--- a/doc/fiber.md
+++ b/doc/fiber.md
@@ -76,10 +76,20 @@ class Scheduler
# Sleep the current task for the specified duration, or forever if not
# specified.
- # @param duration [Numeric] The amount of time to sleep in seconds.
+ # @parameter duration [Numeric] The amount of time to sleep in seconds.
def kernel_sleep(duration = nil)
end
+ # Execute the given block. If the block execution exceeds the given timeout,
+ # the specified exception `klass` will be raised. Typically, only non-blocking
+ # methods which enter the scheduler will raise such exceptions.
+ # @parameter duration [Integer] The amount of time to wait, after which an exception will be raised.
+ # @parameter klass [Class] The exception class to raise.
+ # @parameter *arguments [Array] The arguments to send to the constructor of the exception.
+ # @yields {...} The user code to execute.
+ def timeout_after(duration, klass, *arguments, &block)
+ end
+
# Block the calling fiber.
# @parameter blocker [Object] What we are waiting on, informational only.
# @parameter timeout [Numeric | Nil] The amount of time to wait for in seconds.