Send Success notification when Command is executed
extract Action of the Commands simplify somme classes
This commit is contained in:
@@ -9,7 +9,8 @@ import eventDemo.app.event.GameEventStore
|
||||
import eventDemo.app.event.projection.GameStateRepository
|
||||
import eventDemo.app.event.projection.SnapshotConfig
|
||||
import eventDemo.app.eventListener.PlayerNotificationEventListener
|
||||
import eventDemo.libs.command.CommandStreamChannelBuilder
|
||||
import eventDemo.libs.command.CommandRunnerController
|
||||
import eventDemo.libs.command.CommandStreamChannel
|
||||
import eventDemo.libs.event.EventBusInMemory
|
||||
import eventDemo.libs.event.EventStoreInMemory
|
||||
import eventDemo.libs.event.VersionBuilder
|
||||
@@ -41,12 +42,20 @@ val appKoinModule =
|
||||
GameStateRepository(get(), get(), snapshotConfig = SnapshotConfig())
|
||||
}
|
||||
single {
|
||||
CommandStreamChannelBuilder<GameCommand>()
|
||||
CommandStreamChannel<GameCommand>(get())
|
||||
}
|
||||
single {
|
||||
CommandRunnerController<GameCommand>()
|
||||
}
|
||||
single {
|
||||
GameCommandHandler(get(), get(), get(), get())
|
||||
}
|
||||
|
||||
singleOf(::VersionBuilderLocal) bind VersionBuilder::class
|
||||
singleOf(::GameEventHandler)
|
||||
singleOf(::GameCommandActionRunner)
|
||||
singleOf(::GameCommandHandler)
|
||||
singleOf(::PlayerNotificationEventListener)
|
||||
|
||||
// Actions
|
||||
configureActions()
|
||||
}
|
||||
|
||||
18
src/main/kotlin/eventDemo/configuration/ConfigureDIAction.kt
Normal file
18
src/main/kotlin/eventDemo/configuration/ConfigureDIAction.kt
Normal file
@@ -0,0 +1,18 @@
|
||||
package eventDemo.configuration
|
||||
|
||||
import eventDemo.app.command.action.ICantPlay
|
||||
import eventDemo.app.command.action.IWantToJoinTheGame
|
||||
import eventDemo.app.command.action.IWantToPlayCard
|
||||
import eventDemo.app.command.action.IamReadyToPlay
|
||||
import org.koin.core.module.Module
|
||||
import org.koin.core.module.dsl.singleOf
|
||||
|
||||
/**
|
||||
* Configure all actions
|
||||
*/
|
||||
fun Module.configureActions() {
|
||||
singleOf(::IWantToPlayCard)
|
||||
singleOf(::IamReadyToPlay)
|
||||
singleOf(::IWantToJoinTheGame)
|
||||
singleOf(::ICantPlay)
|
||||
}
|
||||
Reference in New Issue
Block a user