Sha256: 4b2b29ac09e81b8fe86a27e886fceb563bf1aef7a581d9420c55598391bee58c
Contents?: true
Size: 741 Bytes
Versions: 11
Compression:
Stored size: 741 Bytes
Contents
# This file is distributed under New Relic's license terms. # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details. # frozen_string_literal: true module NewRelic module ThreadLocalStorage def self.get(thread, key) if Agent.config[:thread_local_tracer_state] thread.thread_variable_get(key) else thread[key] end end def self.set(thread, key, value) if Agent.config[:thread_local_tracer_state] thread.thread_variable_set(key, value) else thread[key] = value end end def self.[](key) get(::Thread.current, key) end def self.[]=(key, value) set(::Thread.current, key, value) end end end
Version data entries
11 entries across 11 versions & 1 rubygems