class Ractor::MovedObject

Parent:
BasicObject

A special object which replaces any value that was moved to another ractor in Ractor#send or Ractor.yield. Any attempt to access the object results in Ractor::MovedError.

r = Ractor.new { receive }

ary = [1, 2, 3]
r.send(ary, move: true)
p Ractor::MovedObject === ary
# => true
ary.inspect
# Ractor::MovedError (can not send any methods to a moved object)

Ruby Core © 1993–2024 Yukihiro Matsumoto
Licensed under the Ruby License.
Ruby Standard Library © contributors
Licensed under their own licenses.