module ErrorHighlight::LocalSettings
The formatter settings are Ractor-local. On Ruby implementations without Ractor (e.g., JRuby), they are module instance variables instead, which are likewise shared by all threads. Unlike Hash, which is not thread-safe on JRuby, concurrent instance variable updates are serialized (github.com/jruby/jruby/wiki/Concurrency-in-jruby), so threads formatting errors concurrently cannot corrupt the settings.
Constants
- IVARS
- RACTOR_KEYS
Public Class Methods
Source
# File lib/error_highlight/formatter.rb, line 80 def self.[](name) Ractor.current[RACTOR_KEYS.fetch(name)] end
Source
# File lib/error_highlight/formatter.rb, line 84 def self.[]=(name, value) Ractor.current[RACTOR_KEYS.fetch(name)] = value end