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

Update SimpleApplicationEventMulticaster.java #1546

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@muyinchen

muyinchen commented Oct 1, 2017

@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);
}
}
}

Update SimpleApplicationEventMulticaster.java
	@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);
			}
		}
	}
@pivotal-issuemaster

This comment has been minimized.

Show comment
Hide comment
@pivotal-issuemaster

pivotal-issuemaster Oct 1, 2017

@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.

pivotal-issuemaster commented Oct 1, 2017

@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.

@pivotal-issuemaster

This comment has been minimized.

Show comment
Hide comment
@pivotal-issuemaster

pivotal-issuemaster commented Oct 2, 2017

@muyinchen Thank you for signing the Contributor License Agreement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment