loicdescotte
3/1/2013 - 7:53 AM

Reading lines from an InputStream using a play.api.libs.iteratee.Enumerator

Reading lines from an InputStream using a play.api.libs.iteratee.Enumerator

lazy val bufferedReader =  new BufferedReader(new InputStreamReader(inputstream))
val responseStream: Enumerator[String] = Enumerator.generateM[String] {
  Future{
    logger.trace("about to read line")
    val line: String = bufferedReader.readLine()
    logger.trace("read line")
    Option(line)  
  }
}