Created
September 28, 2015 15:04
-
-
Save sam/96c300c88175295d0277 to your computer and use it in GitHub Desktop.
Simple "overwatch" actor to shut down the system when done.
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 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