Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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