-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Propagate trace through Concurrent::Promises.future
Argument passing is preserved through the composited executor. Concurrent::Future has been moved to a prepend style to resolve an infinite call loop situation.
- Loading branch information
Showing
7 changed files
with
178 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
lib/ddtrace/contrib/concurrent_ruby/promises_future_patch.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require 'ddtrace/contrib/concurrent_ruby/context_composite_executor_service' | ||
|
||
module Datadog | ||
module Contrib | ||
module ConcurrentRuby | ||
# This patches the Future - to wrap executor service using ContextCompositeExecutorService | ||
module PromisesFuturePatch | ||
def future_on(default_executor, *args, &task) | ||
unless default_executor.is_a?(ContextCompositeExecutorService) | ||
default_executor = ContextCompositeExecutorService.new(default_executor) | ||
end | ||
|
||
super(default_executor, *args, &task) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters