vineethraj49
07/02/2020, 2:01 PMinit {}
?Dominaezzz
07/02/2020, 2:02 PMrunBlocking { launch { /* task */} }
?vineethraj49
07/02/2020, 2:03 PMgildor
07/02/2020, 2:28 PMvineethraj49
07/02/2020, 2:31 PMCompletableFuture
and .join
and moved on; will try to figure out "where" it got stuck when I get around to it againgildor
07/02/2020, 2:52 PMvineethraj49
07/02/2020, 2:53 PMrunBlocking
attempt got "stuck"gildor
07/02/2020, 2:55 PMOrhan Tozan
07/02/2020, 7:40 PMsuspend init { }
gildor
07/03/2020, 12:54 AMjdemeulenaere
07/08/2020, 9:40 AMsuspend
factory method on the companion object that does all the concurrent stuff needed to initialize your object, e.g.:
class MyClass(val param1: String, val param2: String) {
companion object {
suspend operator fun invoke(): MyClass {
return coroutineScope {
val param1 = async { ... }
val param2 = async { ... }
MyClass(param1.await(), param2.await())
}
}
}
}