From: "ko1 (Koichi Sasada) via ruby-core" Date: 2026-10-15T00:09:12+00:00 Subject: [ruby-core:127116] [Ruby Feature#22441] Add Ractor#alive? Issue #22441 has been updated by ko1 (Koichi Sasada). Matz approved it. ---------------------------------------- Feature #22441: Add Ractor#alive? https://bugs.ruby-lang.org/issues/22441#change-119516 * Author: jhawthorn (John Hawthorn) * Status: Open ---------------------------------------- I propose adding `Ractor#alive?` as a non-blocking way to ask whether a Ractor has finished. This matches `Thread#alive?`/`Fiber#alive?`. ``` r = Ractor.new { Ractor.receive } r.alive? #=> true r << :done r.join r.alive? #=> false ``` This is already somewhat visible via `Ractor#inspect`, but that's quite awkward. We use this in the test suite. ``` r = Ractor.new{ sleep 1 } r.inspect #=> "#" sleep 2 r.inspect #=> "#" ``` After fork, other Ractors `alive?` will return false, as with `Thread#alive?`. https://github.com/ruby/ruby/pull/19349 -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/