Created
June 14, 2018 14:45
-
-
Save adamw/8c954e4eea287d2d2cad9241fb17ea95 to your computer and use it in GitHub Desktop.
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
override def receive: Receive = { | |
case Start(start) => | |
crawlUrl(start) | |
case CrawlResult(url, links) => | |
inProgress -= url | |
links.foreach { link => | |
crawlUrl(link) | |
referenceCount = referenceCount.updated(link.host, | |
referenceCount.getOrElse(link.host, 0) + 1) | |
} | |
if (inProgress.isEmpty) { | |
result.success(referenceCount) | |
context.stop(self) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment