Packages

final case class AndThen[-I, OI, +O, +E](upstream: Evolution[OI, O, E], downstream: Evolution[I, OI, E]) extends Evolution[I, O, E] with Product with Serializable

An Evolution composed of two sequential evolutions.

Parameter naming

The field names are intentionally the reverse of Stage.AndThen. In Stage.AndThen, upstream processes I → OI and downstream processes OI → O. Here it is the other way around:

  • downstream: Evolution[I, OI, E] — holds the evolution of the pipeline's upstream stage (I → OI).
  • upstream: Evolution[OI, O, E] — holds the evolution of the pipeline's downstream stage (OI → O).

The inversion follows from how <~ routes data: upstream(s) <~ downstream(s) feeds downstream's stage first, so the I → OI evolution occupies downstream and OI → O occupies upstream. compose stores its receiver as downstream and its argument as upstream:

pipelineUpstream.skip().compose(pipelineDownstream.skip())
// == Evolution.AndThen(upstream = pipelineDownstream.skip(),
//                      downstream = pipelineUpstream.skip())

Continuation composition

For any status s:

composed(s) == upstream(s) <~ downstream(s)
// data flow: I → downstream's stage → OI → upstream's stage → O

Disposal

Both evolutions are disposed in the order upstream then downstream (i.e. pipeline-downstream first, then pipeline-upstream), matching the reverse-order convention used in Stage.AndThen before disposal was moved to Evolution.

I

input type of the composed pipeline

OI

intermediate type between the two stages

O

output type of the composed pipeline

E

error type

upstream

the evolution of the pipeline's downstream stage (OI → O)

downstream

the evolution of the pipeline's upstream stage (I → OI)

Source
Evolution.scala
Linear Supertypes
Serializable, Product, Equals, Evolution[I, O, E], AnyRef, scala.Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AndThen
  2. Serializable
  3. Product
  4. Equals
  5. Evolution
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new AndThen(upstream: Evolution[OI, O, E], downstream: Evolution[I, OI, E])

    upstream

    the evolution of the pipeline's downstream stage (OI → O)

    downstream

    the evolution of the pipeline's upstream stage (I → OI)

Value Members

  1. final def !=(arg0: scala.Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: scala.Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  6. final def compose[_O, _E >: E](that: Evolution[O, _O, _E]): Evolution[I, _O, _E]

    Composes this evolution with another, creating a new evolution whose continuation for any status is the sequential composition of the corresponding continuations of both evolutions.

    Composes this evolution with another, creating a new evolution whose continuation for any status is the sequential composition of the corresponding continuations of both evolutions.

    Specifically:

    composed(s) == self(s) ~> that(s)

    Used internally when merging evolutions during Yield composition inside Stage.AndThen.

    _O

    the output type of the resulting stages

    _E

    the combined error type

    that

    the downstream evolution to compose with

    returns

    a new evolution representing self followed by that

    Definition Classes
    Evolution
    Annotations
    @inline()
  7. def dispose(): Unit

    Releases resources held by both composed evolutions, disposing upstream first, then downstream.

    Releases resources held by both composed evolutions, disposing upstream first, then downstream.

    If upstream.dispose() throws a non-fatal exception, downstream.dispose() is still attempted. Any non-fatal exception from downstream.dispose() is added as suppressed to the primary before it is re-thrown.

    Definition Classes
    AndThenEvolution
  8. val downstream: Evolution[I, OI, E]
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def evolve(status: Status[_]): Stage[I, O, E]

    Returns the next Stage based on the given status.

    Returns the next Stage based on the given status.

    May release resources that are specific to this evolution instance and will not be reused by subsequent generations (i.e. resources not needed by the returned stage or its own evolution).

    status

    the status that determines the continuation stage

    Definition Classes
    AndThenEvolution
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def map[_I, _O, _E](f: (Stage[I, O, E]) => Stage[_I, _O, _E]): Evolution[_I, _O, _E]

    Transforms every continuation of this evolution by applying f to the stage it returns.

    Transforms every continuation of this evolution by applying f to the stage it returns.

    This is the public API for adapting an Evolution to a different stage type without exposing internal composition details.

    _I

    the input type of the resulting stages

    _O

    the output type of the resulting stages

    _E

    the error type of the resulting stages

    f

    a function that transforms each continuation stage

    returns

    a new evolution with all continuations mapped by f

    Definition Classes
    Evolution
    Annotations
    @inline()
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  17. def productElementNames: Iterator[String]
    Definition Classes
    Product
  18. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  19. val upstream: Evolution[OI, O, E]
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Evolution[I, O, E]

Inherited from AnyRef

Inherited from scala.Any

Ungrouped