February 2018
Intermediate to advanced
350 pages
7h 35m
English
An actor is kind of object that interacts with other actors and with the external world through messages. An actor object can have a private internal mutable state that can be modified and accessed externally through messages, but not directly. Actors are growing in popularity in recent years due to their consistent programming model, and have been tested successfully in multi-million user applications, such as WhatsApp that is built with Erlang, the language that brings actors into the limelight:
import kotlinx.coroutines.experimental.channels.actorsealed class CounterMsgobject IncCounter : CounterMsg()class GetCounter(val response: CompletableDeferred<Int>) : CounterMsg()fun counterActor(start:Int) = actor<CounterMsg> { var counter ...
Read now
Unlock full access