Skip to content
class method

Process.waitall

() -> ::Array[[ ::Integer, ::Process::Status ]]
Process.waitall → array

Waits for all children, returns an array of 2-element arrays; each subarray contains the integer pid and Process::Status status for one of the reaped child processes:

Example
pid0 = Process.spawn('ruby', '-e', 'exit 13') # => 325470
pid1 = Process.spawn('ruby', '-e', 'exit 14') # => 325495
Process.waitall
# => [[325470, #<Process::Status: pid 325470 exit 13>], [325495, #<Process::Status: pid 325495 exit 14>]]
See also .wait2 .waitpid .wait .waitpid2 also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0