okkero
03/12/2017, 7:22 PMfun foo(): Deferred<Int>
So, now the implementer would call async<Int>(...)
and do its thing.
I'm also thinking that I could achieve the same with this declaration:
suspend fun foo(): Int
The implementation would be different, of course, but the end result would be almost the same.
So, here's my question: Should one of these be preferred over the other. If so, which one? And if the latter is preferred, what do I put for context
when calling async<Int>(/*What context?*/)