@Override
public void multicastEvent(final ApplicationEvent event, @Nullable ResolvableType eventType) {
ResolvableType type = (eventType != null ? eventType : resolveDefaultEventType(event));
//Here getTaskExecutor () method to get the foreach loop outside the performance can be optimized
Executor executor = getTaskExecutor();
for (final ApplicationListener<?> listener : getApplicationListeners(event, type)) {
if (executor != null) {
executor.execute(() -> invokeListener(listener, event));
}
else {
invokeListener(listener, event);
}
}
}
Comment From: pivotal-issuemaster
@muyinchen Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
Comment From: pivotal-issuemaster
@muyinchen Thank you for signing the Contributor License Agreement!
Comment From: snicoll
Thanks for the PR and sorry it took so long but this optimization is no longer applicable.