O'Reilly logo

Scala Functional Programming Patterns by Atul S. Khot

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

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 ...

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