summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-12-08 09:29:09 +1300
committerSamuel Williams <samuel.williams@oriontransfer.co.nz>2020-12-09 08:55:35 +1300
commit2553c5f94a5d51c2c5876b31e4c1521ad9be12f6 (patch)
treefc7b8fe6e578424b15dea0f8b94caa7a72b5c0a1 /doc
parenta4a92ae6d99a75e11165ca09c44ccf47cf342047 (diff)
Add support for non-blocking `Process.wait`.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3853
Diffstat (limited to 'doc')
-rw-r--r--doc/scheduler.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/scheduler.md b/doc/scheduler.md
index 9994831..a6e2d78 100644
--- a/doc/scheduler.md
+++ b/doc/scheduler.md
@@ -12,6 +12,17 @@ This is the interface you need to implement.
~~~ ruby
class Scheduler
+ # Wait for the specified process ID to exit.
+ # This hook is optional.
+ # @parameter pid [Integer] The process ID to wait for.
+ # @parameter flags [Integer] A bit-mask of flags suitable for `Process::Status.wait`.
+ # @returns [Process::Status] A process status instance.
+ def process_wait(pid, flags)
+ Thread.new do
+ Process::Status.wait(pid, flags)
+ end.value
+ end
+
# Wait for the given file descriptor to match the specified events within
# the specified timeout.
# @parameter event [Integer] A bit mask of `IO::READABLE`,