play.api.libs.iteratee

Iteratee

object Iteratee

Various helper methods to construct, compose and traverse Iteratees.

Source
Iteratee.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Iteratee
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. trait Consume[E] extends AnyRef

    A partially-applied function returned by the consume method.

  2. trait EofOrElse[E] extends AnyRef

    A partially-applied function returned by the eofOrElse method.

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def consume[E]: Consume[E]

    Create an play.api.libs.iteratee.Iteratee which consumes and concatenates all Input chunks

    Create an play.api.libs.iteratee.Iteratee which consumes and concatenates all Input chunks

    Example:

    // Get all chunks of input
    def getAll: Iteratee[Array[Byte], Array[Byte]] = Iteratee.consume[Array[Byte]]()

    Chunks type should be viewable as TraversableOnce

  7. def eofOrElse[E]: EofOrElse[E]

  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def flatten[E, A](i: Future[Iteratee[E, A]]): Iteratee[E, A]

    flatten a scala.concurrent.Future of play.api.libs.iteratee.Iteratee] into an Iteratee

    flatten a scala.concurrent.Future of play.api.libs.iteratee.Iteratee] into an Iteratee

    i

    a promise of iteratee

  12. def fold[E, A](state: A)(f: (A, E) ⇒ A)(implicit ec: ExecutionContext): Iteratee[E, A]

    Create an play.api.libs.iteratee.Iteratee which folds the content of the Input using a given function and an initial state

    Create an play.api.libs.iteratee.Iteratee which folds the content of the Input using a given function and an initial state

    Example:

    // Count the number of input elements
    def count[E]: Iteratee[E, Int] = Iteratee.fold(0)((c, _) => c + 1)
    state

    initial state

    f

    a function folding the previous state and an input to a new state

    ec

    The context to execute the supplied function with. The context is prepared on the calling thread before being used.

  13. def fold1[E, A](state: Future[A])(f: (A, E) ⇒ Future[A])(implicit ec: ExecutionContext): Iteratee[E, A]

    Create an play.api.libs.iteratee.Iteratee which folds the content of the Input using a given function and an initial state

    Create an play.api.libs.iteratee.Iteratee which folds the content of the Input using a given function and an initial state

    It also gives the opportunity to return a scala.concurrent.Future so that promises are combined in a complete reactive flow of logic.

    state

    initial state

    f

    a function folding the previous state and an input to a new promise of state

    ec

    The context to execute the supplied function with. The context is prepared on the calling thread before being used.

  14. def fold2[E, A](state: A)(f: (A, E) ⇒ Future[(A, Boolean)])(implicit ec: ExecutionContext): Iteratee[E, A]

    Create an play.api.libs.iteratee.Iteratee which folds the content of the Input using a given function and an initial state.

    Create an play.api.libs.iteratee.Iteratee which folds the content of the Input using a given function and an initial state. Like foldM, but the fold can be completed earlier by returning a value of true in the future result.

    state

    initial state

    f

    a function folding the previous state and an input to a promise of state and a boolean indicating whether the fold is done

    ec

    The context to execute the supplied function with. The context is prepared on the calling thread before being used.

  15. def foldM[E, A](state: A)(f: (A, E) ⇒ Future[A])(implicit ec: ExecutionContext): Iteratee[E, A]

    Create an play.api.libs.iteratee.Iteratee which folds the content of the Input using a given function and an initial state

    Create an play.api.libs.iteratee.Iteratee which folds the content of the Input using a given function and an initial state

    M stands for Monadic which in this case means returning a scala.concurrent.Future for the function argument f, so that promises are combined in a complete reactive flow of logic.

    state

    initial state

    f

    a function folding the previous state and an input to a new promise of state

    ec

    The context to execute the supplied function with. The context is prepared on the calling thread before being used.

  16. def foreach[E](f: (E) ⇒ Unit)(implicit ec: ExecutionContext): Iteratee[E, Unit]

    f

    the function that should be executed for every chunk

    returns

    an play.api.libs.iteratee.Iteratee which executes a provided function for every chunk. Returns Done on EOF.

    Example:

    // Get all chunks of input
    def printChunks: Iteratee[String, Unit] = Iteratee.foreach[String]( s => println(s) )
  17. def getChunks[E]: Iteratee[E, List[E]]

    Consume all the chunks from the stream, and return a list.

  18. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  20. def head[E]: Iteratee[E, Option[E]]

    Create an iteratee that takes the first element of the stream, if one occurs before EOF

  21. def ignore[E]: Iteratee[E, Unit]

    returns

    an play.api.libs.iteratee.Iteratee which just ignores its input

  22. def isDoneOrError[E, A](it: Iteratee[E, A]): Future[Boolean]

  23. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  24. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  27. def repeat[E, A](i: Iteratee[E, A]): Iteratee[E, Seq[A]]

    i

    an iteratee used repeatedly to compute a sequence of results

    returns

    an play.api.libs.iteratee.Iteratee which pushes the input into the provided play.api.libs.iteratee.Iteratee, starting over again each time it terminates until an EOF is received, collecting a sequence of results of the different use of the iteratee

  28. def skipToEof[E]: Iteratee[E, Unit]

    Ignore all the input of the stream, and return done when EOF is encountered.

  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  30. def toString(): String

    Definition Classes
    AnyRef → Any
  31. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped