增加eventbus,默认guava实现

This commit is contained in:
2021-04-05 23:00:08 +08:00
parent 0c33f6a919
commit c1d2359ef3
6 changed files with 122 additions and 1 deletions

View File

@@ -0,0 +1,4 @@
package com.synebula.gaea.event
interface IEvent {
}

View File

@@ -0,0 +1,28 @@
package com.synebula.gaea.event
interface IEventBus {
/**
* 注册事件Listener
* @param obj Listener所在类
*/
fun register(obj: Any)
/**
* 取消注册事件Listener
* @param obj Listener所在类
*/
fun unregister(obj: Any)
/**
* 同步发布事件
* @param event 事件
*/
fun publish(event: IEvent)
/**
* 异步发布事件
* @param event 事件
*/
fun publishAsync(event: IEvent)
}