aboutsummaryrefslogtreecommitdiffstats
path: root/sources/hv-collector-health-check/src/main/kotlin/org
diff options
context:
space:
mode:
authorPiotr Jaszczyk <piotr.jaszczyk@nokia.com>2019-04-03 15:07:22 +0200
committerPiotr Jaszczyk <piotr.jaszczyk@nokia.com>2019-04-04 12:57:15 +0200
commitc775e8677cdbf69f2b1c1390d225329c658c0ee2 (patch)
tree707456ffe0817ed2d29d9a62ccf98b9d267283ba /sources/hv-collector-health-check/src/main/kotlin/org
parentc7a3e0738abf581640059587dbb81790339340c9 (diff)
Get rid of arrow-effects usage
Also clean-up dependencies + use Kotlin BOM to force single kotlin-stdlib on classpath. Issue-ID: DCAEGEN2-1392 Change-Id: I447c4686707de81f35f7734255ce0b13c997c4a4 Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com>
Diffstat (limited to 'sources/hv-collector-health-check/src/main/kotlin/org')
-rw-r--r--sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/factory/HealthCheckApiServer.kt9
1 files changed, 5 insertions, 4 deletions
diff --git a/sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/factory/HealthCheckApiServer.kt b/sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/factory/HealthCheckApiServer.kt
index fb5bb9a2..cff8160c 100644
--- a/sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/factory/HealthCheckApiServer.kt
+++ b/sources/hv-collector-health-check/src/main/kotlin/org/onap/dcae/collectors/veshv/healthcheck/factory/HealthCheckApiServer.kt
@@ -19,7 +19,6 @@
*/
package org.onap.dcae.collectors.veshv.healthcheck.factory
-import arrow.effects.IO
import io.netty.handler.codec.http.HttpResponseStatus
import org.onap.dcae.collectors.veshv.healthcheck.api.HealthDescription
import org.onap.dcae.collectors.veshv.healthcheck.api.HealthState
@@ -45,9 +44,9 @@ class HealthCheckApiServer(private val healthState: HealthState,
private val healthDescription: AtomicReference<HealthDescription> = AtomicReference(HealthDescription.STARTING)
- fun start(): IO<ServerHandle> = IO {
+ fun start(): Mono<ServerHandle> = Mono.defer {
healthState().subscribe(healthDescription::set)
- val ctx = HttpServer.create()
+ HttpServer.create()
.tcpConfiguration {
it.addressSupplier { listenAddress }
.doOnUnbound { logClose() }
@@ -57,7 +56,9 @@ class HealthCheckApiServer(private val healthState: HealthState,
routes.get("/health/alive", ::livenessHandler)
routes.get("/monitoring/prometheus", ::monitoringHandler)
}
- NettyServerHandle(ctx.bindNow())
+ .bind()
+ .map { NettyServerHandle(it) }
+
}
private fun readinessHandler(_req: HttpServerRequest, resp: HttpServerResponse) =