mcastiblanco
01/31/2018, 7:21 AMsuspend fun
)
B - when it doesn't block because it will delegate the operation to a different thread (`Deferred<T>`/`Job`)
The convention, from what I have gathered from presentations+docs would be:
- Prefer A
and name the method as you would normally, but of course make it a suspendable function. suspend fun doSomethingNetworkRelated()
- If you have to use B
(e.g because the platform/code you use doesn't support non-blocking IO), name your function so that the invoker knows that they should `await()`/`join()` to guarantee that the computation ends before they continue. For example asyncFetchProfile
or fetchProfileAsync
.
Makes sense?