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 PMDariusz Kuc
06/07/2019, 1:51 PMasync(start = CoroutineStart.LAZY)
Dariusz Kuc
06/07/2019, 1:51 PMDariusz Kuc
06/07/2019, 1:55 PMDariusz Kuc
06/07/2019, 1:56 PMprivate val myDeferred = GlobalScope.async(start = CoroutineStart.LAZY) {
someSuspendableFunction(valueFromRuntime)
}
suspend fun functionA() = myAnotherService.firstMethod(myDeferred.await())
suspend fun functionB() = myAnotherService.secondMethod(myDeferred.await())
Dariusz Kuc
06/07/2019, 1:57 PMCoroutineScope
instead of a global one