Created
October 16, 2011 08:47
-
-
Save oluies/1290674 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
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