Chapter 9. Actors


In this chapter
  • General design principles using actors
  • Knowing the difference between react and receive
  • Using typed communication and sealed message protocols
  • Limiting failures to zones using supervisors
  • Limiting starvation to zones using schedulers


Actors are an abstraction on a synchronous processes. They communicate to the external world by sending and receiving messages. An actor will process received messages sequentially in the order they’re received, but will handle only one message at a time. This is critical, because it means that actors can maintain state without explicit locks. Actors can also be asynchronous or synchronous. Most actors won’t block a thread when waiting for messages, although this can be ...

Get Scala in Depth now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.