Dariusz Kuc
04/11/2019, 5:54 AMby lazy
. I'm migrating now to coroutines was wondering whats the proper way to update by lazy
to call suspendable function. Any thoughts on how to make this better?Mark
06/07/2019, 6:31 AMDariusz Kuc
06/07/2019, 1:48 PMasync(start = CoroutineStart.LAZY)
private val myDeferred = GlobalScope.async(start = CoroutineStart.LAZY) {
someSuspendableFunction(valueFromRuntime)
}
suspend fun functionA() = myAnotherService.firstMethod(myDeferred.await())
suspend fun functionB() = myAnotherService.secondMethod(myDeferred.await())
CoroutineScope
instead of a global one