Book Image

Mastering play framework for scala

By : Shiti Saxena
Book Image

Mastering play framework for scala

By: Shiti Saxena

Overview of this book

Table of Contents (21 chapters)
Mastering Play Framework for Scala
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
1
Getting Started with Play
Index

Actor Model


Concurrency in programming can be achieved by using Threads which may include the risk of a lost update or a deadlock. The Actor Model facilitates concurrency by utilizing asynchronous communication.

According to the Actor Model, an actor is the fundamental unit of computation. It cannot exist independently, that is, it is always part of a specific actor system. An actor can send messages to one or more actors within its actor system if it knows the address of the other actor. It can also send messages to itself. The order in which the messages are sent or received cannot be guaranteed since the communication is asynchronous.

When an actor receives a message, it can do the following:

  • Forward it to another actor whose address is known to it

  • Create more actors

  • Designate the action it will take for the next message

Note

The Actor Model was first described in August 1973 in a publication by Carl Hewitt, Peter Bishop and Richard Steiger in the paper A Universal Modular ACTOR Formalism for...