Object/Trait

play.api.libs.iteratee

Iteratee

Related Docs: trait Iteratee | package iteratee

Permalink

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
Visibility
  1. Public
  2. All

Type Members

  1. trait Consume[E] extends AnyRef

    Permalink

    A partially-applied function returned by the consume method.

  2. trait EofOrElse[E] extends AnyRef

    Permalink

    A partially-applied function returned by the eofOrElse method.

Value Members

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

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

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

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

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

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

    Permalink

    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]

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

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

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

    Permalink
    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]]

    Permalink

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

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

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

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

    Permalink

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

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

    Permalink

    returns

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

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

    Permalink
  23. def isEmpty[E]: Iteratee[E, Boolean]

    Permalink

    Determines whether or not a stream contains any elements.

    Determines whether or not a stream contains any elements. A stream can be empty if it has no inputs (except Input.EOF) or if it consists of only Input.Empty elements (and Input.EOF.) A stream is non-empty if it contains an Input.El.

    This iteratee consumes the stream as far as the first EOF or Input.El, skipping over any Input.Empty elements. When it encounters an Input.EOF or Input.El it is Done.

    Will consume intermediate Input.Empty elements but does not consume Input.El or Input.EOF.

  24. final def isInstanceOf[T0]: Boolean

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

    Permalink
    Definition Classes
    AnyRef
  26. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

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

    Permalink

    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

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

    Permalink

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

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

    Permalink
    Definition Classes
    AnyRef
  31. def takeUpTo[E](n: Int): Iteratee[E, Seq[E]]

    Permalink

    Read up to n chunks from the stream stopping when that number of chunks have been read or the stream end is reached.

    Read up to n chunks from the stream stopping when that number of chunks have been read or the stream end is reached. If the stream has fewer elements then only those elements are returned. Will consume intermediate Input.Empty elements but does not consume Input.EOF.

  32. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped