Skip to content

Instantly share code, notes, and snippets.

@petrovg
Last active December 21, 2015 14:49
Show Gist options
  • Select an option

  • Save petrovg/6322197 to your computer and use it in GitHub Desktop.

Select an option

Save petrovg/6322197 to your computer and use it in GitHub Desktop.
Consuming a web resource in chunks with a Play framework Iteratee
import play.api.libs.ws._
import play.api.libs.iteratee._
import scala.concurrent.ExecutionContext.Implicits.global
WS.url("http://www.bbc.co.uk").get( resp => Iteratee.fold(0) { (i:Int, el:Array[Byte] ) => println(el); i + 1} )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment