Last active
November 14, 2016 15:46
-
-
Save James-Parsons/37d3630ec0a7dc750d1f to your computer and use it in GitHub Desktop.
A suicidal actor for a web socket.
This file contains hidden or 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
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