trait Evolution[-I, +O, +E] extends AnyRef
The continuation of a Stage: which stage handles the next input, chosen by the Status of the run that just finished. This is what makes a pipeline able to change as it runs — every Yield carries one.
An Evolution is also the exclusive owner of cleanup for the stage that produced it: see dispose.
The status to select on is the one carried alongside the evolution in the same yield, which is why callers normally go through Yield.evolve rather than dispatching on a status themselves. In a composed pipeline that status is the combined one of the whole run, never a single stage's own.
- I
the input type of the stages returned (contravariant)
- O
their output type (covariant)
- E
the error type (covariant)
- Alphabetic
- By Inheritance
- Evolution
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
dispose(): Unit
Releases everything held by the Stage that produced this evolution.
Releases everything held by the Stage that produced this evolution. That stage is permanently unusable afterwards — neither applied nor skipped again — and this is the only place its resources are released.
Whoever terminates a pipeline is responsible for disposing the evolution of the final Yield, so that the continuation is released at once instead of being carried around. The reference terminal driver is the
executeextension method ofh8io.stages.basein the lib module.dispose()stays valid after evolve has been called on the same instance, and must then release everything still alive, including whatever building the continuation acquired.evolvehands over no ownership: this evolution remains the cleanup point for its lineage until the continuation has run and produced an evolution of its own, which takes the role over from that moment.Exceptions are not part of this contract: a stage whose
applythrows produces no yield and therefore no evolution, so there is nothing to dispose — it must clean up after itself (see the Lifecycle section in Stage).A no-op is a fine implementation for a stage holding nothing external.
-
abstract
def
evolve(status: Status[_]): Stage[I, O, E]
The next stage, for the given status.
The next stage, for the given status.
May release what belongs to this generation alone — anything the returned stage and its own evolution will not reuse.
evolveand dispose are not mutually exclusive. Usually only one of them is called on an instance: a terminal driver disposes, a continuing pipeline evolves and drops the previous evolution. But a caller may do both, and operators owning their inner stage (Loop,Repeatand the rest ofh8io.stages.cyclesin the lib module) do exactly that — they evolve eagerly and keep the innerdisposeas the cleanup handle of the generation they just built.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @IntrinsicCandidate()
-
final
def
compose[_O, _E >: E](that: Evolution[O, _O, _E]): Evolution[I, _O, _E]
Composes this evolution with the one downstream of it, so that for every status
Composes this evolution with the one downstream of it, so that for every status
composed(s) == self(s) ~> that(s)
This is how Yield composition carries both continuations of a pipeline forward; application code rarely calls it directly.
- Annotations
- @inline()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
map[_I, _O, _E](f: (Stage[I, O, E]) ⇒ Stage[_I, _O, _E]): Evolution[_I, _O, _E]
Applies
fto every stage this evolution would return, leaving disposal delegated to it unchanged.Applies
fto every stage this evolution would return, leaving disposal delegated to it unchanged.The way an operator keeps its wrapping in place across generations: the continuation comes back wrapped the same way the current stage is.
- Annotations
- @inline()
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated