Clean and fix
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
package eventDemo.configuration
|
||||
|
||||
import eventDemo.app.command.GameCommandHandler
|
||||
import eventDemo.app.event.GameEventBus
|
||||
import eventDemo.app.event.GameEventStream
|
||||
import eventDemo.app.eventListener.GameEventPlayerNotificationListener
|
||||
import eventDemo.libs.event.EventBusInMemory
|
||||
import eventDemo.libs.event.EventStreamInMemory
|
||||
import io.ktor.server.application.Application
|
||||
import io.ktor.server.application.install
|
||||
import org.koin.core.module.dsl.singleOf
|
||||
import org.koin.dsl.module
|
||||
import org.koin.ktor.plugin.Koin
|
||||
import org.koin.logger.slf4jLogger
|
||||
@@ -19,10 +22,15 @@ fun Application.configureKoin() {
|
||||
|
||||
val appKoinModule =
|
||||
module {
|
||||
single {
|
||||
GameEventBus(EventBusInMemory())
|
||||
}
|
||||
single {
|
||||
GameEventStream(get(), EventStreamInMemory())
|
||||
}
|
||||
single {
|
||||
GameEventBus(EventBusInMemory())
|
||||
GameCommandHandler(get())
|
||||
}
|
||||
|
||||
singleOf(::GameEventPlayerNotificationListener)
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package eventDemo.configuration
|
||||
|
||||
import eventDemo.app.command.GameCommandHandler
|
||||
import eventDemo.app.command.gameSocket
|
||||
import eventDemo.app.event.GameEventBus
|
||||
import eventDemo.app.event.GameEventStream
|
||||
import eventDemo.app.eventListener.GameEventPlayerNotificationListener
|
||||
import io.ktor.server.application.Application
|
||||
import io.ktor.server.routing.routing
|
||||
|
||||
fun Application.declareWebSocketsGameRoute(
|
||||
eventStream: GameEventStream,
|
||||
eventBus: GameEventBus,
|
||||
playerNotificationListener: GameEventPlayerNotificationListener,
|
||||
commandHandler: GameCommandHandler,
|
||||
) {
|
||||
routing {
|
||||
gameSocket(eventStream, eventBus)
|
||||
gameSocket(playerNotificationListener, commandHandler)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user