Sha256: 382829d852cf538c5a7398bd2c9dc9ca4a1072953e1d4361a89c8ed23d3f183f
Contents?: true
Size: 728 Bytes
Versions: 9
Compression:
Stored size: 728 Bytes
Contents
# frozen_string_literal: true module Jaeger module Client class ScopeManager # @api private class ScopeStack def initialize # Generate a random identifier to use as the Thread.current key. This is # needed so that it would be possible to create multiple tracers in one # thread (mostly useful for testing purposes) @scope_identifier = ScopeIdentifier.generate end def push(scope) store << scope end def pop store.pop end def peek store.last end private def store Thread.current[@scope_identifier] ||= [] end end end end end
Version data entries
9 entries across 9 versions & 2 rubygems