Class: OpenTelemetry::Adapters::ConcurrentRuby::ContextCompositeExecutorService
- Inherits:
-
Object
- Object
- OpenTelemetry::Adapters::ConcurrentRuby::ContextCompositeExecutorService
- Extended by:
- Forwardable
- Includes:
- Concurrent::ExecutorService
- Defined in:
- lib/opentelemetry/adapters/concurrent_ruby/context_composite_executor_service.rb
Overview
Wraps existing executor to carry over trace context
Instance Attribute Summary collapse
-
#composited_executor ⇒ Object
Returns the value of attribute composited_executor.
Instance Method Summary collapse
-
#initialize(composited_executor) ⇒ ContextCompositeExecutorService
constructor
A new instance of ContextCompositeExecutorService.
-
#post(*args, &task) ⇒ Object
post method runs the task within composited executor in a different thread.
Constructor Details
#initialize(composited_executor) ⇒ ContextCompositeExecutorService
Returns a new instance of ContextCompositeExecutorService.
20 21 22 |
# File 'lib/opentelemetry/adapters/concurrent_ruby/context_composite_executor_service.rb', line 20 def initialize(composited_executor) @composited_executor = composited_executor end |
Instance Attribute Details
#composited_executor ⇒ Object
Returns the value of attribute composited_executor.
18 19 20 |
# File 'lib/opentelemetry/adapters/concurrent_ruby/context_composite_executor_service.rb', line 18 def composited_executor @composited_executor end |
Instance Method Details
#post(*args, &task) ⇒ Object
post method runs the task within composited executor in a different thread
26 27 28 29 30 31 32 33 34 |
# File 'lib/opentelemetry/adapters/concurrent_ruby/context_composite_executor_service.rb', line 26 def post(*args, &task) context = OpenTelemetry::Context.current @composited_executor.post(*args) do OpenTelemetry::Context.with_current(context) do yield end end end |