-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf($EventBus): support async event bus; support dynamic component scan
- Loading branch information
1 parent
6938193
commit fe1de45
Showing
7 changed files
with
120 additions
and
39 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...uth-center-biz/src/main/kotlin/com/jmsoftware/maf/authcenter/event/DemoEventSubscriber.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.jmsoftware.maf.authcenter.event | ||
|
||
import com.google.common.eventbus.AllowConcurrentEvents | ||
import com.google.common.eventbus.EventBus | ||
import com.google.common.eventbus.Subscribe | ||
import com.jmsoftware.maf.common.util.logger | ||
import com.jmsoftware.maf.springcloudstarter.eventbus.DemoEvent | ||
import com.jmsoftware.maf.springcloudstarter.eventbus.EventSubscriber | ||
|
||
/** | ||
* # DemoEventSubscriber | ||
* | ||
* Change description here. | ||
* | ||
* @author Johnny Miller (锺俊), email: johnnysviva@outlook.com, 6/23/22 7:46 AM | ||
**/ | ||
@EventSubscriber | ||
@Suppress("unused") | ||
class DemoEventSubscriber( | ||
private val eventBus: EventBus | ||
) { | ||
companion object { | ||
private val log = logger() | ||
} | ||
|
||
@Subscribe | ||
@AllowConcurrentEvents | ||
fun subscribe(demoEvent: DemoEvent) { | ||
log.info("Got subscription: $demoEvent") | ||
} | ||
} |
17 changes: 0 additions & 17 deletions
17
auth-center/auth-center-biz/src/main/kotlin/com/jmsoftware/maf/authcenter/event/EventTest.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...cloud-starter/src/main/kotlin/com/jmsoftware/maf/springcloudstarter/eventbus/DemoEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.jmsoftware.maf.springcloudstarter.eventbus | ||
|
||
import cn.hutool.core.util.IdUtil | ||
|
||
/** | ||
* # DemoEvent | ||
* | ||
* Change description here. | ||
* | ||
* @author Johnny Miller (锺俊), email: johnnysviva@outlook.com, 6/25/22 1:18 PM | ||
**/ | ||
data class DemoEvent( | ||
val id: String = IdUtil.nanoId(), | ||
val name: String = DemoEvent::class.java.simpleName | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters