Chapter 10. Actors and Message Passing


"All the world's a stage, and all the men and women merely players: they have their exits and their entrances; and one man in his time plays many parts, his acts being seven ages."

 --William Shakespeare

Consider a simple, almost everyday use case—going to the market and buying vegetables. Do we know who grew the produce? Do we know which patch of land gave us this leafy food? We usually don't know about this.

On the other side of the coin, does the farmer who grew the crop and took such loving care of it know who bought his produce ultimately? He does not. He is content enough in knowing that his produce goes to the market.

This is essentially decoupling. The producer does know that there is a consumer somewhere ...

Get Scala Functional Programming Patterns now with O’Reilly online learning.

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