From: "shan (Shannon Skipper)" Date: 2022-07-20T03:18:09+00:00 Subject: [ruby-core:109255] [Ruby master Bug#18919] Ractor: can't share method-to-proc objects Issue #18919 has been updated by shan (Shannon Skipper). This is just an aside, but what it's worth you can pass the class and method name and reconstitute a Method instance inside a Ractor. ``` ruby require 'bigdecimal' meth = Kernel.method(:BigDecimal) ractor = Ractor.new(meth.owner, meth.name) do |meth_owner, meth_name| meth_owner.method(meth_name) end ractor.take.call(42) #=> 0.42e2 ``` ---------------------------------------- Bug #18919: Ractor: can't share method-to-proc objects https://bugs.ruby-lang.org/issues/18919#change-98387 * Author: chucke (Tiago Cardoso) * Status: Open * Priority: Normal * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- The following is not shareable: ```ruby > meth = ::Kernel.method(:BigDecimal) => # :816:in `make_shareable': can not make shareable object for # (Ractor::Error) ``` I understand that procs have the issue of accessing outer-scope variables, but does the same apply to methods converted to procs? -- https://bugs.ruby-lang.org/ Unsubscribe: