Skip to content
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

Asynchronous execution of ApplicationListeners through annotation [SPR-3876] #8556

Closed
spring-projects-issues opened this issue Sep 14, 2007 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Sep 14, 2007

Steven Devijver opened SPR-3876 and commented

Attached is a 3-class implementation that lets ApplicationListener implementations execute in an asynchronous fashion:

@Async
public class MyApplicationListener implements ApplicationListener {
public void onApplicationEvent(ApplicationEvent event) {
// do something
}
}

The implementation includes a BPP that detects @Async on ApplicationListeners and wraps them in a decorator with a TaskExecutor. On arrival of an event the onApplicationEvent() method is executed in a seperate thread.


Attachments:

Issue Links:

2 votes, 3 watchers

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Mar 24, 2008

David J. M. Karlsen commented

FYI: This is supported if you use the http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/context/event/SimpleApplicationEventMulticaster.html by setting a TaskExecutor - configured on the event submitting side.

#8211 is along the same generic @Async approach as in this request (marking arbitrary methods as @Asynchronous).

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0 M2 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants