Skip to content

Instantly share code, notes, and snippets.

@pjazdzewski1990
Created May 13, 2015 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjazdzewski1990/d79afb990106646f885c to your computer and use it in GitHub Desktop.
Save pjazdzewski1990/d79afb990106646f885c to your computer and use it in GitHub Desktop.
val behavior: Behavior[HumanCommand] =
Total {
case Eat(food) ⇒
println(s"Tasty $food!")
Stopped
case Wait() ⇒
Same
}
val log: PartialFunction[MessageOrSignal[HumanCommand], Unit] = {
case m: Msg => logger.info(s"Got message $m")
case s: Sig => logger.info(s"Got signal $s")
}
val behaviorTapped: Behavior[HumanCommand] =
Tap(log, behavior)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment