elizarov
10/01/2018, 1:13 PMDeferred
as your return type. Write a suspending function instead:
suspend fun doSomething(param: Int): Something {
code ...
}
See how much more concise it is!nwh
10/01/2018, 8:58 PMlaunch
or other coroutine control. By returning Deferred
you make that optional, allowing callers to call and forget about the result.jdemeulenaere
10/01/2018, 9:07 PMnwh
10/01/2018, 9:08 PM