All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zalando.axiom.web.krueger.Extensions.kt Maven / Gradle / Ivy

Go to download

This library creates vertx web endpoints exposing application metrics that can be consumed by Krueger (https://github.com/zalando/krueger-cockpit)

There is a newer version: 1.2.0
Show newest version
package org.zalando.axiom.web.krueger

import io.vertx.core.AsyncResultHandler
import io.vertx.core.Future
import io.vertx.core.Vertx

fun  List>.flatten() : Map = this.flatMap { e -> e.entries }.toMapBy({ e -> e.key }, { e -> e.value })

fun  Vertx.executeBlocking(handler: AsyncResultHandler, callback: () -> T) {
    executeBlocking({ future: Future ->
        future.complete(callback())
    }, { result ->
        if (result.succeeded()) {
            handler.handle(Future.succeededFuture(result.result()))
        } else {
            handler.handle(Future.failedFuture(result.cause()))
        }
    })
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy