Skip to content

Commit

Permalink
testing CIO engine instead of TOMCAT
Browse files Browse the repository at this point in the history
  • Loading branch information
lamba92 committed Jun 21, 2020
1 parent 4fa6365 commit e96e755
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions analytics-server-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ kotlin {
api(project(":core"))

api(ktor("server-tomcat", ktorVersion))
api(ktor("server-cio", ktorVersion))
api(ktor("serialization", ktorVersion))
api(ktor("locations", ktorVersion))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ import io.ktor.response.respondText
import io.ktor.routing.route
import io.ktor.routing.routing
import io.ktor.serialization.json
import io.ktor.server.cio.CIO
import io.ktor.server.engine.embeddedServer
import io.ktor.server.tomcat.Tomcat
import io.ktor.util.KtorExperimentalAPI
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import kotlinx.serialization.builtins.list
Expand All @@ -30,8 +31,8 @@ import org.slf4j.event.Level
import kotlin.time.ExperimentalTime
import kotlin.time.minutes

@OptIn(KtorExperimentalLocationsAPI::class, ExperimentalTime::class)
fun getServer(datasource: DatasourceElaborator) = embeddedServer(Tomcat) {
@OptIn(KtorExperimentalLocationsAPI::class, ExperimentalTime::class, KtorExperimentalAPI::class)
fun getServer(datasource: DatasourceElaborator) = embeddedServer(CIO) {

install(ContentNegotiation) {
json()
Expand Down

0 comments on commit e96e755

Please sign in to comment.