-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdeploy.kt
30 lines (26 loc) · 900 Bytes
/
deploy.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package examples
import io.vertx.core.AbstractVerticle
import io.vertx.core.DeploymentOptions
import io.vertx.core.Future
import io.vertx.kotlin.lang.*
import io.vertx.kotlin.lang.json.object_
class DeployVerticle : AbstractVerticle() {
override fun start() {
verticle("deployMe") {
when (it) {
is AsyncSuccessResult -> println("Successfully deployed with ID ${it.result}")
is AsyncErrorResult -> println("Failed to deploy verticle with error ${it.error}")
}
}
}
}
class DeployVerticleWithOptionsAsync : AbstractVerticle() {
override fun start(startFuture: Future<Void>) {
val deploymentOptions = DeploymentOptions().withConfig {
object_(
"myOption" to "1"
)
}
verticle("yo", deploymentOptions) { r -> r.sendToFutureVoid(startFuture) }
}
}