Jag Saund
1 min readJan 11, 2019

--

Think of Actors and Coroutines as two different things. A Coroutine is a way to perform some unit of work. That work can happen on a thread, but it can be suspended to allow another Coroutine to resume on that same thread. This allows for concurrent operations to take place, managed by the Kotlin Runtime, multiplexed on to a single thread. This is what is often meant by “Coroutines are like lightweight threads”.

Actors are a combination of a Coroutine and a Channel. You can send information off to an actor. The actor operates within a Coroutine and reads from that channel to process work. Channels are the way for you to communicate safely between Coroutines.

An actor creates a SendChannel. You could also use a “produce” builder to create a ReceiveChannel.

--

--

Jag Saund

Android Engineer || ex Periscope, Amazon, Upthere || Sometimes a Photographer (to get me away from my computer)