Sha256: e7aec9cc6f1fd4700284e28e28459400e34616f46edb9eaa870c2f98e5d080be
Contents?: true
Size: 858 Bytes
Versions: 16
Compression:
Stored size: 858 Bytes
Contents
# typed: true module Datadog module OpenTracer # OpenTracing adapter for thread local scopes # @public_api class ThreadLocalScope < Scope attr_reader \ :finish_on_close def initialize( manager:, span:, finish_on_close: true ) super(manager: manager, span: span) @finish_on_close = finish_on_close @previous_scope = manager.active end # Mark the end of the active period for the current thread and Scope, # updating the ScopeManager#active in the process. # # NOTE: Calling close more than once on a single Scope instance leads to # undefined behavior. def close return unless equal?(manager.active) span.finish if finish_on_close manager.send(:set_scope, @previous_scope) end end end end
Version data entries
16 entries across 16 versions & 1 rubygems