Sha256: fd193f560e5af77539933e5807c5b3c0d49e73317976532574c91f0fcd1b743a

Contents?: true

Size: 742 Bytes

Versions: 2

Compression:

Stored size: 742 Bytes

Contents

# frozen_string_literal: true

# Copyright 2020 OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0

module OpenTelemetry
  module Adapters
    module ConcurrentRuby
      # The Adapter class contains logic to detect and install the
      # ConcurrentRuby instrumentation adapter
      class Adapter < OpenTelemetry::Instrumentation::Adapter
        install do |_config|
          require_dependencies
          patch
        end

        present do
          defined?(::Concurrent::Future)
        end

        private

        def require_dependencies
          require_relative 'patches/future'
        end

        def patch
          ::Concurrent::Future.send(:include, Patches::Future)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
opentelemetry-adapters-concurrent_ruby-0.4.0 lib/opentelemetry/adapters/concurrent_ruby/adapter.rb
opentelemetry-adapters-concurrent_ruby-0.3.0 lib/opentelemetry/adapters/concurrent_ruby/adapter.rb