Deactivated User
12/29/2016, 12:03 AMsuspend fun Method.invokeSuspend(obj: Any?, args: List<Any?>): Any? = asyncFun {
I'm always appending asyncFun to all suspend, but it s a bit redundant, and when no calling other suspension tail positions, it could automatically add this, that doesn't depend on any special thing (promises, or futures or anything):
inline suspend fun <T> asyncFun(routine: suspend () -> T): T = suspendCoroutine<T> { routine.startCoroutine(it) }