Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method · added in Ruby 3.4
Ractor.[]=
(::Symbol, untyped) -> untyped
[]=(sym, val)
ractor.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/ractor.rb, line 515
def self.[]=(sym, val)
Primitive.ractor_local_value_set(sym, val)
end
Sets a value in ractor-local storage for the current Ractor.
Ruby version changes
-
3.4
-
Ractor.[]andRactor.[]=are added to access the ractor local storage of the currentRactor. [Feature #20715]
-