-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #1408 Add ability to multi-decorate backing ExecutorServices #1409
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1409 +/- ##
============================================
+ Coverage 84.2% 84.34% +0.13%
- Complexity 3869 3896 +27
============================================
Files 357 357
Lines 29349 29509 +160
Branches 5452 5495 +43
============================================
+ Hits 24712 24888 +176
+ Misses 3035 3027 -8
+ Partials 1602 1594 -8
Continue to review full report at Codecov.
|
static ScheduledExecutorService decorateExecutorService(String schedulerType, | ||
String description, Supplier<? extends ScheduledExecutorService> supplier) { | ||
final Tuple2<String, String> metadata = Tuples.of(schedulerType, description); | ||
ScheduledExecutorService result = factory.decorateExecutorService(schedulerType, supplier); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this PR, the provided wrapper executor service would have been the outer most one (since there could be only one) but here it will be the inner most one. I'm wondering if we should keep this behaviour and call factory.decorateExecutorService
at the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that makes sense, and easy enough to do 👍
d219e29
to
c0c3aae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fast-track requested by @simonbasle
@smaldini I wonder if the
decorateExecutorService
method at theSchedulers
level should be made accessible to outside implementors ofScheduler
(since outside implementations would need to call it in order for the decorators to be applied to internals)