https://kotlinlang.org logo
#coroutines
Title
# coroutines
c

cedric

03/05/2017, 4:05 AM
@elizarov Did you mean "Confine coroutine execution on a non main thread"? Coroutines are typically network or file stuff, they should be kept out of the the EDT
e

elizarov

03/05/2017, 7:13 AM
You can do animations on the main thread with coroutine. Perfectly fine use-case.
As for IO, you only need to offload blocking IO out of the main thread. If your IO is non blocking (all represented as suspending functions) then you can use it from UI-confined coroutines directly. It becomes really easy to program if everything is non-blocking.
3 Views