O'Reilly logo

Actors in Scala by Frank Sommers, Philipp Haller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

2.2 Actors and messages

The main mechanism for unifying control flow and data flow is a special abstraction, the actor, and the message-based communication that takes place between actors. An actor is any object that can exchange messages with other actors. In the actor programming model, actors communicate solely by passing messages to each other.

In a pure actor system, every object is an actor. For instance, in Erlang, another language that defines an actor programming model, even atomic objects, such as Ints and Strings, are actors. Scala's actors library, by contrast, allows you to easily turn any Scala object into an actor, but does not require that all objects be actors.

Actors have a uniform public interface: An actor can, in general, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required