Object

play.api.libs.streams

Streams

Related Doc: package streams

Permalink

object Streams

Methods to adapt Futures, Promises, Iteratees and Enumerators to and from Reactive Streams' Publishers and Subscribers.

Source
Streams.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Streams
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

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. def accumulatorToIteratee[T, U](accumulator: Accumulator[T, U])(implicit mat: Materializer): Iteratee[T, U]

    Permalink

    Adapt an Accumulator to an Iteratee.

    Adapt an Accumulator to an Iteratee.

    This is done by creating an Akka streams Subscriber based Source, and adapting that to an Iteratee, before running the Akka streams source.

    This method for adaptation requires a Materializer to materialize the subscriber, however it does not materialize the subscriber until the iteratees fold method has been invoked.

  5. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def enumerateeToProcessor[A, B](enumeratee: Enumeratee[A, B]): Processor[A, B]

    Permalink

    Adapt an Enumeratee to a Processor.

  8. def enumeratorToPublisher[T](enum: Enumerator[T], emptyElement: Option[T] = None): Publisher[T]

    Permalink

    Adapt an Enumerator to a Publisher.

    Adapt an Enumerator to a Publisher. Each Subscriber will be adapted to an Iteratee and applied to the Enumerator. Input of type Input.El will result in calls to onNext.

    Either onError or onComplete will always be invoked as the last call to the subscriber, the former happening if the enumerator fails with an error, the latter happening when the first of either Input.EOF is fed, or the enumerator completes.

    If emptyElement is None then Input of type Input.Empty will be ignored. If it is set to Some(x) then it will call onNext with the value x.

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def futureToPublisher[T](fut: Future[T]): Publisher[T]

    Permalink

    Adapt a Future into a Publisher.

    Adapt a Future into a Publisher. For a successful Future the Publisher will emit a single element with the value. For a failed Future the Publisher will emit an onError event.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. def iterateeDoneToPublisher[T, U](iter: Iteratee[T, U]): Publisher[U]

    Permalink

    Adapt an Iteratee to a Publisher, publishing its Done value.

    Adapt an Iteratee to a Publisher, publishing its Done value. If the iteratee is *not* Done then an exception is published.

    This method is similar in its effect to Iteratee.run, which extracts the final value from an Iteratee. However, unlike Iteratee.run, this method will not feed an EOF input to the Iteratee.

  17. def iterateeToAccumulator[T, U](iter: Iteratee[T, U]): Accumulator[T, U]

    Permalink

    Adapt an Iteratee to an Accumulator.

    Adapt an Iteratee to an Accumulator.

    This is done by adapting the iteratee to a subscriber, and then creating an Akka streams Sink from that, which is mapped to the result of running the adapted iteratee subscriber result.

  18. def iterateeToProcessor[T, U](iter: Iteratee[T, U]): Processor[T, U]

    Permalink

    Adapt an Iteratee to a Processor, which consumes input and then yields the iteratee's Done value.

    Adapt an Iteratee to a Processor, which consumes input and then yields the iteratee's Done value. It uses iterateeToSubscriber and iterateeDoneToPublisher to create each end of the Processor.

  19. def iterateeToSubscriber[T, U](iter: Iteratee[T, U]): (Subscriber[T], Iteratee[T, U])

    Permalink

    Adapt an Iteratee to a Subscriber and a result Iteratee.

    Adapt an Iteratee to a Subscriber and a result Iteratee.

    The Subscriber requests elements one-by-one and feeds them to each Iteratee Cont step. When the Iteratee step is Done or Error, the Subscription is cancelled.

    The result iteratee will be fulfilled when either the Iteratee or the Subscriber subscription completes. The result Iteratee may be in a Cont, Done or Error state, or a fourth state that will yield errors or failed Futures when its methods are called.

    Calls to onNext send an Input.El to the iteratee and calls to onComplete send an Input.EOF. If onError is called then the iteratee enters an invalid state.

    If the Iteratee is in a Done or Error state then it will cancel the Subscription as soon as possible, but it may still receive calls to onError or onComplete. These calls are ignored. Be careful because this means that it is possible for the Subscriber to "consume" events, even if the Iteratee doesn't.

  20. def join[T, U](subr: Subscriber[T], pubr: Publisher[U]): Processor[T, U]

    Permalink

    Join a Subscriber and Publisher together to make a Processor.

    Join a Subscriber and Publisher together to make a Processor. The Processor delegates its Subscriber methods to the Subscriber and its Publisher methods to the Publisher. The Processor otherwise does nothing.

  21. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  24. def processorToEnumeratee[A, B](processor: Processor[A, B]): Enumeratee[A, B]

    Permalink

    Adapt a Processor to an Enumeratee.

  25. def promiseToProcessor[T](prom: Promise[T]): Processor[T, T]

    Permalink

    Adapt a Promise into a Processor, creating an Processor that consumes a single element and publishes it.

    Adapt a Promise into a Processor, creating an Processor that consumes a single element and publishes it. The Subscriber end of the Processor is created with promiseToSubscriber. The Publisher end of the Processor is created with futureToPublisher.

  26. def promiseToSubscriber[T](prom: Promise[T]): Subscriber[T]

    Permalink

    Adapt a Promise into a Subscriber.

    Adapt a Promise into a Subscriber. The Subscriber accepts a single value which is used to complete the Promise. If the Subscriber's onError method is called then the Promise is completed with a failure.

    A call to onError after onNext is called will be ignored.

  27. def publisherToEnumerator[T](pubr: Publisher[T]): Enumerator[T]

    Permalink

    Adapt a Publisher to an Enumerator.

    Adapt a Publisher to an Enumerator. This is achieved by adapting any Iteratees into Subscribers using the iterateeToSubscriber method.

  28. def subscriberToIteratee[T](subscriber: Subscriber[T]): Iteratee[T, Unit]

    Permalink

    Adapt a Subscriber to an Iteratee.

    Adapt a Subscriber to an Iteratee.

    The Iteratee will attempt to give the Subscriber as many elements as demanded. When the subscriber cancels, the iteratee enters the done state.

    Feeding EOF into the iteratee will cause the Subscriber to be fed a completion event, and the iteratee will go into the done state.

    The iteratee will not enter the Cont state until demand is requested by the subscriber.

    This Iteratee will never enter the error state, unless the subscriber deviates from the reactive streams spec.

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

    Permalink
    Definition Classes
    AnyRef
  30. def toString(): String

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

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped