Skip to content

Instantly share code, notes, and snippets.

@sam
Created September 28, 2015 15:04
Show Gist options
  • Save sam/96c300c88175295d0277 to your computer and use it in GitHub Desktop.
Save sam/96c300c88175295d0277 to your computer and use it in GitHub Desktop.
Simple "overwatch" actor to shut down the system when done.
import akka.actor._
object Scraper {
def props = Props[Scraper]
}
class Scraper extends Actor with ActorLogging with Unhandled {
import MigrationProtocol._
val sources = context.actorOf(Props[Sources])
def receive = {
case parse @ Parse(_) =>
context.actorOf(Job.props(sources)) ! parse
case Done =>
context.self ! PoisonPill
context.system.shutdown()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment