Sha256: 179f77ec03521cc6bc014b96fcbe5bbbc661e666c662336f29a06bc6a92e14bf

Contents?: true

Size: 812 Bytes

Versions: 30

Compression:

Stored size: 812 Bytes

Contents

require 'ddtrace/contrib/patcher'

module Datadog
  module Contrib
    module ConcurrentRuby
      # Patcher enables patching of 'Future' class.
      module Patcher
        include Contrib::Patcher

        module_function

        def patched?
          done?(:concurrent_ruby)
        end

        def patch
          do_once(:concurrent_ruby) do
            begin
              require 'ddtrace/contrib/concurrent_ruby/future_patch'

              patch_future
            rescue StandardError => e
              Datadog::Tracer.log.error("Unable to apply Future integration: #{e}")
            end
          end
        end

        # Propagate tracing context in Concurrent::Future
        def patch_future
          ::Concurrent::Future.send(:include, FuturePatch)
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
ls-trace-0.1.2 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.29.1 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.26.1 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ls-trace-0.1.1 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.29.0 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.28.0 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.27.0 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.26.0 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.25.1 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.25.0 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.24.0 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.23.3 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.23.2 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.23.1 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.23.0 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.22.0 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.21.2 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.21.1 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.21.0 lib/ddtrace/contrib/concurrent_ruby/patcher.rb
ddtrace-0.20.0 lib/ddtrace/contrib/concurrent_ruby/patcher.rb