Sha256: 7ee3b65c82b911737e637668fe9430965591776b88c773395b8e36f37a220672
Contents?: true
Size: 1.37 KB
Versions: 19
Compression:
Stored size: 1.37 KB
Contents
# frozen_string_literal: true require_relative '../patcher' module Datadog module Tracing module Contrib module ConcurrentRuby # Patcher enables patching of 'Future' and 'Async' classes. module Patcher include Contrib::Patcher module_function def target_version Integration.version end def patch require_relative 'future_patch' patch_future require_relative 'promises_future_patch' patch_promises_future require_relative 'async_patch' async_patch end # Propagate tracing context in Concurrent::Async def async_patch if defined?(::Concurrent::Async) # NOTE: AsyncDelegator is a private constant ::Concurrent::Async.const_get(:AsyncDelegator).prepend(AsyncPatch) end end # Propagate tracing context in Concurrent::Future def patch_future ::Concurrent::Future.prepend(FuturePatch) if defined?(::Concurrent::Future) end # Propagate tracing context in Concurrent::Promises::Future def patch_promises_future ::Concurrent::Promises.singleton_class.prepend(PromisesFuturePatch) if defined?(::Concurrent::Promises::Future) end end end end end end
Version data entries
19 entries across 19 versions & 2 rubygems