Skip to content

Instantly share code, notes, and snippets.

@James-Parsons
Last active November 14, 2016 15:46
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save James-Parsons/37d3630ec0a7dc750d1f to your computer and use it in GitHub Desktop.
A suicidal actor for a web socket.
import akka.actor._
object SuicidalActor {
def props(out: ActorRef) = Props(new SuicidalActor(out))
}
class SuicidalActor(out: ActorRef) extends Actor {
def receive = {
case msg: String =>
out ! ("I hate my life!"))
self ! PoisonPill
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment