groostav
06/16/2017, 6:04 PMclass LongRunningTaskHandle {
fun start()
suspend fun waitForFinish()
}
is it better to simply expose that as
class LongRunningTaskHandle {
suspend fun execute() { start(); waitForFinish(); }
}
such that callers who want async behaviour are forced to explicitly get it through launch
, thereby avoiding the "I forgot to call the suspending function" bug?