This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Human extends Actor with ActorLogging { | |
override def receive: Receive = { | |
case Hello => log.info("Hello dear :)") | |
case HowAreYou => log.info("I'm fine dude, thanks for asking") | |
case HowIAm(happy) => | |
if (happy) log.info("I am Groot") | |
else log.info("Well, have a kitkat") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Human { | |
def props = Props[Human] | |
// Saying Hello | |
case object Hello | |
// Asking how Someone is | |
case object HowAreYou | |
// response to someone asking how we are |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Human extends Actor with ActorLogging { | |
override def receive: Receive = { | |
case message: String => log.info(s"I received the following message $message") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name := "akka-quickstart-scala" | |
version := "1.0" | |
scalaVersion := "2.12.6" | |
lazy val akkaVersion = "2.5.22" | |
libraryDependencies ++= Seq( | |
// la seule dépendance dont on aura besoin pour l'instant sera celle du core d'Akka |