class Ractor::MovedObject - Documentation for Ruby 4.0
Description: class Ractor::MovedObject: Port#send. MovedError.
Keywords: ruby,class,Ractor::MovedObject

🔍

No recent searches

# class Ractor::MovedObject

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`.

    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)

### Public Instance Methods

! (*args)
Alias for: method_missing
!= (*args)
Alias for: method_missing
== (*args)
Alias for: method_missing
__id__ (*args)
Alias for: method_missing
__send__ (*args)
Alias for: method_missing
equal? (*args)
Alias for: method_missing
instance_eval (*args)
Alias for: method_missing
instance_exec (*args)
Alias for: method_missing
method_missing (*args)
Source

    static VALUE
    ractor_moved_missing(int argc, VALUE *argv, VALUE self)
    {
        rb_raise(rb_eRactorMovedError, "can not send any methods to a moved object");
    }

Also aliased as: __send__, !, ==, !=, __id__, equal?, instance_eval, instance_exec