Sha256: ad17a83fb63feb7429eaf8213ab60ba628c5890e6faafe8abb7ad65824a04587

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

require_relative 'concurrent_ruby/instrumentation'
require_relative 'concurrent_ruby/chain'
require_relative 'concurrent_ruby/prepend'

DependencyDetection.defer do
  named :'concurrent_ruby'

  depends_on do
    defined?(Concurrent) &&
      defined?(Concurrent::VERSION) &&
      Gem::Version.new(Concurrent::VERSION) >= Gem::Version.new('1.1.5')
  end

  executes do
    if use_prepend?
      prepend_instrument(Concurrent::ThreadPoolExecutor, NewRelic::Agent::Instrumentation::ConcurrentRuby::Prepend)

      [Concurrent::Promises.const_get(:'InternalStates')::Rejected,
        Concurrent::Promises.const_get(:'InternalStates')::PartiallyRejected].each do |klass|
          klass.prepend(NewRelic::Agent::Instrumentation::ConcurrentRuby::ErrorPrepend)
        end
    else
      chain_instrument NewRelic::Agent::Instrumentation::ConcurrentRuby::Chain
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
newrelic_rpm-9.16.0 lib/new_relic/agent/instrumentation/concurrent_ruby.rb
newrelic_rpm-9.15.0 lib/new_relic/agent/instrumentation/concurrent_ruby.rb