Skip to content

Commit 0a3abb0

Browse files
committed
Migrate to Vert.x 5 APIs and bump Kotlin to 2.3.0-RC2 to support Java 25
1 parent 9b2cca6 commit 0a3abb0

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

frameworks/Kotlin/vertx-web-kotlinx/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ tasks.wrapper {
33
}
44

55
plugins {
6-
val kotlinVersion = "2.2.21"
6+
val kotlinVersion = "2.3.0-RC2"
77
kotlin("jvm") version kotlinVersion
88
kotlin("plugin.serialization") version kotlinVersion
99
application
@@ -34,6 +34,6 @@ dependencies {
3434
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.7.1") // TODO try using this in the code
3535
}
3636

37-
kotlin.jvmToolchain(21) // Kotlin doesn't support Java 25 yet
37+
kotlin.jvmToolchain(25) // Kotlin doesn't support Java 25 yet
3838

3939
application.mainClass.set("MainKt")

frameworks/Kotlin/vertx-web-kotlinx/src/main/kotlin/Main.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import io.vertx.core.impl.cpu.CpuCoreSensor
33
import io.vertx.kotlin.core.deploymentOptionsOf
44
import io.vertx.kotlin.core.vertxOptionsOf
55
import io.vertx.kotlin.coroutines.coAwait
6+
import java.util.function.Supplier
67
import java.util.logging.Logger
78

89
const val SERVER_NAME = "Vert.x-Web Kotlinx Benchmark server"
@@ -18,7 +19,9 @@ suspend fun main(args: Array<String>) {
1819
logger.info("Vertx exception caught: $it")
1920
it.printStackTrace()
2021
}
21-
vertx.deployVerticle({ MainVerticle(hasDb) }, deploymentOptionsOf(instances = CpuCoreSensor.availableProcessors()))
22-
.coAwait()
22+
vertx.deployVerticle(
23+
Supplier { MainVerticle(hasDb) },
24+
deploymentOptionsOf(instances = CpuCoreSensor.availableProcessors())
25+
).coAwait()
2326
logger.info("$SERVER_NAME started.")
2427
}

frameworks/Kotlin/vertx-web-kotlinx/src/main/kotlin/VertxCoroutine.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ import io.vertx.core.Future
22
import io.vertx.kotlin.coroutines.coAwait
33

44
suspend fun <T> List<Future<T>>.awaitAll(): List<T> =
5-
Future.all(this).coAwait().list()
5+
Future.all<T>(this).coAwait().list()

0 commit comments

Comments
 (0)