create GameListRepositoryInRedis

This commit is contained in:
2025-03-30 03:09:01 +02:00
parent 2fb4c778fd
commit 70d596acf0
4 changed files with 79 additions and 14 deletions

View File

@@ -4,7 +4,7 @@ import com.zaxxer.hikari.HikariConfig
import com.zaxxer.hikari.HikariDataSource
import eventDemo.adapter.infrastructureLayer.event.GameEventBusInMemory
import eventDemo.adapter.infrastructureLayer.event.GameEventStoreInPostgresql
import eventDemo.adapter.infrastructureLayer.event.projection.GameListRepositoryInMemory
import eventDemo.adapter.infrastructureLayer.event.projection.GameListRepositoryInRedis
import eventDemo.adapter.infrastructureLayer.event.projection.GameProjectionBusInMemory
import eventDemo.adapter.infrastructureLayer.event.projection.GameStateRepositoryInRedis
import eventDemo.business.event.GameEventBus
@@ -21,7 +21,7 @@ import redis.clients.jedis.UnifiedJedis
import javax.sql.DataSource
fun Module.configureDIInfrastructure(config: Configuration) {
factory {
single {
JedisPooled(config.redisUrl)
} bind UnifiedJedis::class
@@ -47,6 +47,6 @@ fun Module.configureDIInfrastructure(config: Configuration) {
} bind GameStateRepository::class
single {
GameListRepositoryInMemory(get(), get(), get(), snapshotConfig = SnapshotConfig())
GameListRepositoryInRedis(get(), get(), snapshotConfig = SnapshotConfig())
} bind GameListRepository::class
}