diff --git a/README.md b/README.md index 15d7dce4..60ef8806 100644 --- a/README.md +++ b/README.md @@ -135,8 +135,7 @@ public void onMyNoticeEvent(MyNoticeEvent event) { } // fire an event -EventBus.syncSubmit(MyNoticeEvent.valueOf("同步事件")); -EventBus.asyncSubmit(MyNoticeEvent.valueOf("异步事件")); +EventBus.submit(MyNoticeEvent.valueOf("My event")); ``` #### 7. [scheduler](scheduler/README.md) scheduling Framework Based on Cron Expression diff --git a/README_CN.md b/README_CN.md index 7080125f..d9881d16 100644 --- a/README_CN.md +++ b/README_CN.md @@ -131,8 +131,7 @@ public void onMyNoticeEvent(MyNoticeEvent event) { } // 抛出一个事件 -EventBus.syncSubmit(MyNoticeEvent.valueOf("同步事件")); -EventBus.asyncSubmit(MyNoticeEvent.valueOf("异步事件")); +EventBus.submit(MyNoticeEvent.valueOf("我的事件")); ``` #### 7. [scheduler](scheduler/README.md) 基于cron表达式的定时任务调度框架 diff --git a/event/src/test/java/com/zfoo/event/ApplicationTest.java b/event/src/test/java/com/zfoo/event/ApplicationTest.java index 10ad8479..ec1a5b4d 100644 --- a/event/src/test/java/com/zfoo/event/ApplicationTest.java +++ b/event/src/test/java/com/zfoo/event/ApplicationTest.java @@ -26,18 +26,15 @@ import org.springframework.context.support.ClassPathXmlApplicationContext; @Ignore public class ApplicationTest { - // 事件总线教程,核心思想是设计模式中的观察者模式 + // Event Bus tutorial, the core idea is the observer pattern.(核心思想是设计模式中的观察者模式) @Test public void startEventTest() { - // 加载配置文件,配置文件中必须引入event + // load the configuration file which must import event.(加载配置文件,配置文件中必须引入event) var context = new ClassPathXmlApplicationContext("application.xml"); - // 事件的接受需要在被Spring管理的bean的方法上加上@EventReceiver注解,即可自动注册事件的监听 - // 参考MyController1中的标准注册方法 + // see receiver method of MyController1 and MyController2 + EventBus.submit(MyNoticeEvent.valueOf("我的事件")); - EventBus.submit(MyNoticeEvent.valueOf("处理事件")); - - // 睡眠3秒,等待异步事件执行完 ThreadUtils.sleep(3000); }