July 2018
Intermediate to advanced
266 pages
7h 11m
English
By default, actors will be started as soon as they are created. You can pass a CoroutineStart to change this behavior according to what you need. For example:
val actor = actor<String>(start = CoroutineStart.LAZY) { for (msg in channel) { println(msg) }}
In this case, the actor will be started when it first receives a message.
Read now
Unlock full access