<@U0QKGKMKN> It takes just a few lines for a libra...
# coroutines
e
@uhe It takes just a few lines for a library like OkHttp:
Copy code
suspend fun Call.await(): Response = suspendCancellableCoroutine { cont ->
    enqueue(object : Callback {
        override fun onResponse(call: Call, response: Response) { cont.resume(response) }
        override fun onFailure(call: Call, e: IOException) { cont.resumeWithException(e) }
    })
    cont.invokeOnCompletion { cancel() }
}
Does one really needs a library for 7 lines of code?
😃 1