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