Skip to content

Instantly share code, notes, and snippets.

@oluies
Created October 16, 2011 08:47
Show Gist options
  • Save oluies/1290674 to your computer and use it in GitHub Desktop.
Save oluies/1290674 to your computer and use it in GitHub Desktop.
package cusin
import scalax.io._
import Resource._
import FileWriterBackend.xmlParserService
import FileWriterBackend.ParseLineRequest
import akka.actor.PoisonPill
object App {
def main(args: Array[String]): Unit = {
val fileName = "\\temp\\sampledata2.txt"
implicit val codec = Codec.ISO8859
val in: Input = Resource.fromURL("file://" + fileName)
val start = System.nanoTime()
// send lines starting with <? to the xmlParser services
in.lines().filter(_.startsWith("<?")).zipWithIndex.foreach { case (line, no) ⇒ xmlParserService ! ParseLineRequest(no, line) }
Thread.sleep(1000);
FileWriterBackend.xmlParserService ? PoisonPill
val end = System.nanoTime()
println((end - start) / 1000000000.0 )
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment