Sha256: 246804bdaadd2dd5e38966d3e7460586a71290ce1d7b286fa4603b1dac199f76

Contents?: true

Size: 351 Bytes

Versions: 7

Compression:

Stored size: 351 Bytes

Contents

# (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2016

module Instana
  module ThreadLocal
    def thread_local(name)
      key = "__#{self}_#{name}__".intern

      define_method(name) do
        Thread.current[key]
      end

      define_method(name.to_s + '=') do |value|
        Thread.current[key] = value
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
instana-1.195.4 lib/instana/thread_local.rb
instana-1.195.3 lib/instana/thread_local.rb
instana-1.195.2 lib/instana/thread_local.rb
instana-1.195.1 lib/instana/thread_local.rb
instana-1.195.0 lib/instana/thread_local.rb
instana-1.193.6 lib/instana/thread_local.rb
instana-1.193.5 lib/instana/thread_local.rb