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