-
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
There should be an additive option for decorating ExecutorServices, potentially outside the Factory #1408
Comments
The current |
proposed API: The legacy Factory |
after discussing with @smaldini and @marcingrzejszczak, maybe a composite |
As a consumer, I would indeed prefer working with String key than having to keep a |
Libraries like Sleuth use the
Schedulers.Factory
to decorate the backingScheduledExecutorService
, rather than changing theScheduler
implementations themselves.Now that we want to introduce a thin
Micrometer
instrumentation wrapper (#1201) that would work on the sameExecutorServices
, it appears this can be problematic. It has also proven error-prone when user code captures aScheduler
before a library sets aFactory
for the purpose ofExecutorService
-wrapping, without actually touching theSchedulers
, becausesetFactory
always shuts down previous schedulers 😢 (see spring-cloud/spring-cloud-sleuth#866)As a result, it would be far better to have
Schedulers.addDecorator
andSchedulers.removeDecorator
type of methods, which would allow additive set up ofExecutorService
decorators separately from theScheduler Factory
.The text was updated successfully, but these errors were encountered: