This example uses
- Akka Persistence for persistent actors,
- Persistent FSM (finite state machine) for states and transitions,
- ScalaPB to generate Scala classes from Protobuf messages
sbt test
sbt> console
scala> import akka.actor.{ActorRef, ActorSystem, Props}
scala> import ranked.GameProtocol.Team._
scala> import ranked.GameProtocol._
scala> import ranked._
scala> val system = ActorSystem("TestSystem")
scala> val game: ActorRef = system.actorOf(Props[Game], "game1")
scala> game ! StartGame()
scala> game ! NewGoal(TEAM_A)
scala> game ! NewGoal(TEAM_B)
scala> system.terminate()
scala> :quit
sbt> console
scala> import akka.actor.{ActorRef, ActorSystem, Props}
scala> import ranked.GameProtocol.Team._
scala> import ranked.GameProtocol._
scala> import ranked._
scala> val system = ActorSystem("TestSystem")
scala> val game: ActorRef = system.actorOf(Props[Game], "game1")
[INFO] Recovery completed!
scala> scala> game ! GetScore()
[INFO] Score: Team A has 1 goals and Team B has 1 goals.