Created
March 1, 2013 07:53
-
-
Save oxlade39/5063137 to your computer and use it in GitHub Desktop.
Reading lines from an InputStream using a play.api.libs.iteratee.Enumerator
This file contains 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
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) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment