theory
Asynchronous implementations can use event, or asynchronous execution;
spring comes with the support of the event, the core is ApplicationEventPublisher;
Event includes three main points:
- Definition of an event;
- The definition of the event listeners;
- Publishing events;
Real
Code path: https://github.com/carterbrother/springbootpractice/tree/master/demo-event