Module: Datadog::Contrib::ConcurrentRuby::Patcher
- Includes:
- Patcher
- Defined in:
- lib/ddtrace/contrib/concurrent_ruby/patcher.rb
Overview
Patcher enables patching of ‘Future’ class.
Class Method Summary collapse
- .patch ⇒ Object
-
.patch_future ⇒ Object
Propagate tracing context in Concurrent::Future.
- .patched? ⇒ Boolean
Methods included from Patcher
Class Method Details
.patch ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/ddtrace/contrib/concurrent_ruby/patcher.rb', line 16 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 |
.patch_future ⇒ Object
Propagate tracing context in Concurrent::Future
29 30 31 |
# File 'lib/ddtrace/contrib/concurrent_ruby/patcher.rb', line 29 def patch_future ::Concurrent::Future.send(:include, FuturePatch) end |
.patched? ⇒ Boolean
12 13 14 |
# File 'lib/ddtrace/contrib/concurrent_ruby/patcher.rb', line 12 def patched? done?(:concurrent_ruby) end |