Module: Farce::Unshareable

Overview

Note:

Mixin in this module will remove the freeze method from the class.

Mixin that makes sure instances cannot be shared between Ractors.

Examples:

class MyClass
  include Farce::Unshareable
end

object = MyClass.new
object.freeze # this would normally make it shareable

Ractor.shareable?(object) # => false

Defined Under Namespace

Modules: Copyable, Movable

Instance Method Summary collapse

Instance Method Details

#initialize ⇒ BasicObject

Make sure to call super if you include this module. Accepts any arguments and passes them on to the superclass initializer.



47
48
49
50
# File 'lib/farce/unshareable.rb', line 47

def initialize(...)
  pin_unshareable
  super
end

#ractor_shareable? ⇒ Boolean

Returns false.

Returns:

  • (Boolean) —

    false

See Also:



54
# File 'lib/farce/unshareable.rb', line 54

def ractor_shareable? = false