Sha256: 6c750df3d4adb941e54aee80c671b12830b12aff8ccc1acce18659d8700748a9

Contents?: true

Size: 503 Bytes

Versions: 43

Compression:

Stored size: 503 Bytes

Contents

# Copyright (c) 2014 AppNeta, Inc.
# All rights reserved.

module Oboe
  ##
  # Provides thread local storage for Oboe.
  #
  # Example usage:
  # module OboeBase
  #   extend ::Oboe::ThreadLocal
  #   thread_local :layer_op
  # end
  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

43 entries across 43 versions & 1 rubygems

Version Path
oboe-2.7.19-java lib/oboe/thread_local.rb
oboe-2.7.19 lib/oboe/thread_local.rb
oboe-2.7.18-java lib/oboe/thread_local.rb
oboe-2.7.18 lib/oboe/thread_local.rb
oboe-2.7.17.1-java lib/oboe/thread_local.rb
oboe-2.7.17.1 lib/oboe/thread_local.rb
oboe-2.7.16.1 lib/oboe/thread_local.rb
oboe-2.7.16.1-java lib/oboe/thread_local.rb
oboe-2.7.15.1-java lib/oboe/thread_local.rb
oboe-2.7.15.1 lib/oboe/thread_local.rb
oboe-2.7.14.1-java lib/oboe/thread_local.rb
oboe-2.7.14.1 lib/oboe/thread_local.rb
oboe-2.7.13.3-java lib/oboe/thread_local.rb
oboe-2.7.13.3 lib/oboe/thread_local.rb
oboe-2.7.12.1-java lib/oboe/thread_local.rb
oboe-2.7.12.1 lib/oboe/thread_local.rb
oboe-2.7.11.1 lib/oboe/thread_local.rb
oboe-2.7.11.1-java lib/oboe/thread_local.rb
oboe-2.7.10.1-java lib/oboe/thread_local.rb
oboe-2.7.10.1 lib/oboe/thread_local.rb