Class: Ractor::MovedObject

Inherits:
BasicObject
Defined in:
ractor.c,
ractor.c

Overview

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)

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args) ⇒ Object


1947
1948
1949
1950
1951
# File 'ractor.c', line 1947

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

Instance Method Details

#!(*args) ⇒ Object


1947
1948
1949
1950
1951
# File 'ractor.c', line 1947

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

#!=(*args) ⇒ Object


1947
1948
1949
1950
1951
# File 'ractor.c', line 1947

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

#==(*args) ⇒ Object


1947
1948
1949
1950
1951
# File 'ractor.c', line 1947

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

#__id__(*args) ⇒ Object


1947
1948
1949
1950
1951
# File 'ractor.c', line 1947

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

#__send__(*args) ⇒ Object

override methods defined in BasicObject


1947
1948
1949
1950
1951
# File 'ractor.c', line 1947

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

#equal?(*args) ⇒ Boolean

Returns:

  • (Boolean)

1947
1948
1949
1950
1951
# File 'ractor.c', line 1947

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

#instance_eval(*args) ⇒ Object


1947
1948
1949
1950
1951
# File 'ractor.c', line 1947

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

#instance_exec(*args) ⇒ Object


1947
1948
1949
1950
1951
# File 'ractor.c', line 1947

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