<@U1TCY49GT> This library has its own `ListenableF...
# coroutines
e
@dstarcev This library has its own
ListenableFuture
interface and even provides
toCompletableFuture
method, so you can just add a dependency on
kotlinx-coroutines-jdk8
module of
kotlinx.coroutines
project and define:
Copy code
suspend fun <V> ListenableFuture<V>.await(): V =
    toCompletableFuture().await()
With this suspending function in hand, using this async http library from a coroutine is straightforward, for example:
Copy code
fun main(args: Array<String>) = runBlocking<Unit> {
    val asyncHttpClient = DefaultAsyncHttpClient()
    val response = asyncHttpClient.prepareGet("<http://www.example.com/>").execute().await()
    println(response.statusCode)
}