Pablo
02/16/2021, 4:02 PMsuspendCancelableCoroutine{..}
? Then do i need the launch{}
somewhere? Or from the java class I call the method of my presenter and that's it? I can avoid the launch?diesieben07
02/16/2021, 4:16 PMCompletableFuture
or something similar.
E.g.:
suspend fun doSomething(): String = TODO()
fun doSomethingFutureAsync(): CompletableFuture<String> = future { doSomething() }
This uses future
from `kotlinx-coroutines-jdk8`: https://github.com/Kotlin/kotlinx.coroutines/tree/master/integration/kotlinx-coroutines-jdk8.Pablo
02/16/2021, 4:18 PMdiesieben07
02/16/2021, 4:21 PMfuture {
// suspending code here
}
Which produces a CompletableFuture
directly - and lets you suspend.