Skip to content

JannikArndt/akka-persistence-protobuf-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Akka Persistence with Protobuf

This example uses

Getting started

  • sbt test

Running in the console

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.

About

Example for using Akka Persistent FSM with Protobuf and ScalaPB

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages