Skip to content

Instantly share code, notes, and snippets.

@johanandren
Last active May 2, 2017 15:35
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 johanandren/35bdebef9d3a084a8f7dc88070485767 to your computer and use it in GitHub Desktop.
Save johanandren/35bdebef9d3a084a8f7dc88070485767 to your computer and use it in GitHub Desktop.
import akka.actor.{Actor, ActorSystem, Props, Stash}
class MyActor extends Actor with Stash {
def receive = {
case _ =>
unstashAll()
println("after unstashAll")
}
}
object StashFailApp extends App {
val system = ActorSystem()
val ref = system.actorOf(Props(classOf[MyActor]))
ref ! "boom"
ref ! "bang"
ref ! "kaboom"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment