https://kotlinlang.org logo
#coroutines
Title
# coroutines
e

enleur

01/04/2018, 12:22 PM
Copy code
suspend fun call(): Element {
    return suspendCancellableCoroutine { continuation ->
        client.request(Element("request"), object : Handler {
            override fun success(response: Element) {
                continuation.resume(response)
            }

            override fun error(response: Element) {
                continuation.resume(response)
            }
        })
    }
}
v

voddan

01/04/2018, 12:24 PM
shouldn't it handle coroutine cancellation ?
e

enleur

01/04/2018, 2:11 PM
it’s simplified
2 Views