spring events

 

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:

  1. Definition of an event;
  2. The definition of the event listeners;
  3. Publishing events;

 

 

 

 

 

Real

 

 

 

Code path: https://github.com/carterbrother/springbootpractice/tree/master/demo-event

 

Guess you like

Origin www.cnblogs.com/snidget/p/11358784.html