elizarov
12/30/2016, 12:11 PMbackground{}
like this:
fun background(block: suspend () -> Unit) {
block.startCoroutine(completion = object : Continuation<Unit> {
override fun resume(value: Unit) {} // done - nothing to do
override fun resumeWithException(exception: Throwable) {
exception.printStackTrace() // log exception
}
})
}