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

Introducing Akka Actors


Akka is a part of the Typesafe Reactive Platform, which is similar to the Play Framework. According to their website:

Akka is a toolkit and runtime used to build highly concurrent, distributed, and fault-tolerant event-driven applications on the JVM.

Akka implements a version of the Actor Model, which is commonly called Akka Actors and is available for both Java and Scala. According to the Akka documentation, Actors give you:

  • Simple and high-level abstractions for concurrency and parallelism

  • Asynchronous, nonblocking, and highly performant event-driven programming model

  • Very lightweight event-driven processes (several million actors per GB of heap memory)

Akka Actors are available as a library and can be used within a project by adding them into the dependencies:

libraryDependencies ++= Seq(
  "com.typesafe.akka" %% "akka-actor" % "2.3.4"
)

Note

Adding a dependency in Akka explicitly is not required in a Play project as Play uses Akka internally.

We can then define an actor...