Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class · Ruby 4.1

Ractor::MovedObject

< BasicObject 9 instance methods

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

Example
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)

Instance methods 9