-
Notifications
You must be signed in to change notification settings - Fork 1.1k
GH-8642: Revise executors in the project #8647
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
Conversation
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.
I started looking at this but I stopped after the first class; I don't think using the ExecutorServiceAdapter
is correct - why do we need it? Why not use the TE directly?
The default SATE will never be stopped.
It is correct when we need a |
Then force the TE to be an /**
* The executor for threads that poll the consumer.
*/
private AsyncTaskExecutor listenerTaskExecutor; I don't see any way to stop the default TE otherwise. |
Right. Missed that one. Thanks. Let me rework it then!
Right. With |
Fixes spring-projects#8642 * Rework some `Executors.newSingleThreadExecutor()` to `ExecutorServiceAdapter(new SimpleAsyncTaskExecutor())` * Expose `TaskExecutor` setters; deprecate `ExecutorService`-based * Some other code clean up in the effected classes: `LogAccessor`, no `synchronized` in critical blocks * Give a meaningful prefix for default threads in the context of components, e.g. `SubscribableRedisChannel` - `getBeanName() + "-"`
`PostgresSubscribableChannel` initialization to let it create its internal `Executor`
|
* @deprecated since 6.2 in favor of {@link #setTaskExecutor(AsyncTaskExecutor)} | ||
*/ | ||
@Deprecated(since = "6.2", forRemoval = true) | ||
public void setTaskExecutor(ExecutorService taskExecutor) { |
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.
Why the name change (and param)? Need to deprecate the existing method.
as an accident after property auto-renaming
Fixes #8642
Executors.newSingleThreadExecutor()
toExecutorServiceAdapter(new SimpleAsyncTaskExecutor())
TaskExecutor
setters; deprecateExecutorService
-basedLogAccessor
, nosynchronized
in critical blocksSubscribableRedisChannel
-getBeanName() + "-"