Actions
Feature #17513
openMethods of shareable objects and UnboundMethods should be shareable
    Feature #17513:
    Methods of shareable objects and UnboundMethods should be shareable
  
Description
class Foo
  def foo
  end
end
f = Foo.new.freeze
Ractor.shareable?(f) # => true
Ractor.make_shareable(f.method(:foo).to_proc) # => Proc, ok
Ractor.make_shareable(f.method(:foo)) # => Ractor::Error, expected Method
Ractor.make_shareable(Foo.instance_method(:foo)) # => Ractor::Error, expected UnboundMethod
  
        
          
          Updated by Eregon (Benoit Daloze) almost 5 years ago
          
          
        
        
      
      Methods can be defined via define_method { capture_state } and so rely on mutable state, so I guess this is only OK for def methods.
        
          
          Updated by marcandre (Marc-Andre Lafortune) almost 5 years ago
          
          
        
        
      
      Agreed, some methods can not be made shareable 👍.
        
          
          Updated by jeremyevans0 (Jeremy Evans) about 2 years ago
          
          
        
        
      
      - Tracker changed from Bug to Feature
 - ruby -v deleted (
3.0.0p0) - Backport deleted (
2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN) 
        
          
          Updated by hsbt (Hiroshi SHIBATA) over 1 year ago
          
          
        
        
      
      - Status changed from Open to Assigned
 
Actions