Projection was now built on listener events

Create ProjectionBus and use it with listeners
add EventStream::getByVersion
This commit is contained in:
2025-03-18 21:48:37 +01:00
parent 908cc888ad
commit 8c1eabb9f5
22 changed files with 126 additions and 89 deletions

View File

@@ -3,29 +3,28 @@ package eventDemo.configuration.injection
import eventDemo.adapter.infrastructureLayer.event.GameEventBusInMemory
import eventDemo.adapter.infrastructureLayer.event.GameEventStoreInMemory
import eventDemo.adapter.infrastructureLayer.event.projection.GameListRepositoryInMemory
import eventDemo.adapter.infrastructureLayer.event.projection.GameProjectionBusInMemory
import eventDemo.adapter.infrastructureLayer.event.projection.GameStateRepositoryInMemory
import eventDemo.business.event.GameEventBus
import eventDemo.business.event.GameEventStore
import eventDemo.business.event.projection.GameProjectionBus
import eventDemo.business.event.projection.gameList.GameListRepository
import eventDemo.business.event.projection.gameState.GameStateRepository
import eventDemo.libs.event.projection.SnapshotConfig
import org.koin.core.module.Module
import org.koin.core.module.dsl.singleOf
import org.koin.dsl.bind
fun Module.configureDIInfrastructure() {
single {
GameEventBusInMemory()
} bind GameEventBus::class
singleOf(::GameEventBusInMemory) bind GameEventBus::class
singleOf(::GameEventStoreInMemory) bind GameEventStore::class
singleOf(::GameProjectionBusInMemory) bind GameProjectionBus::class
single {
GameEventStoreInMemory()
} bind GameEventStore::class
single {
GameStateRepositoryInMemory(get(), get(), snapshotConfig = SnapshotConfig())
GameStateRepositoryInMemory(get(), get(), get(), snapshotConfig = SnapshotConfig())
} bind GameStateRepository::class
single {
GameListRepositoryInMemory(get(), get(), snapshotConfig = SnapshotConfig())
GameListRepositoryInMemory(get(), get(), get(), snapshotConfig = SnapshotConfig())
} bind GameListRepository::class
}