StageOps

h8io.stages.base.`package`.StageOps
final implicit class StageOps[I, O, E](val stage: Stage[I, O, E]) extends AnyVal

Extension methods for Stage.

Attributes

Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

def execute(in: I): Outcome[O, E]

Executes this stage end-to-end and returns a plain Outcome.

Executes this stage end-to-end and returns a plain Outcome.

This is the reference terminal driver of the pipeline model. Internally this method:

  1. Applies the stage to in, obtaining a h8io.stages.Yield.
  2. Disposes the h8io.stages.Evolution carried by the Yield — since execute is a terminal operation, the continuation is not needed and the resources held by the stage must be released immediately.
  3. Wraps the result in an Outcome.Some or Outcome.None.

Disposal failures do not prevent the result from being returned. Any non-fatal exception raised by h8io.stages.Evolution.dispose is captured in Outcome.disposeFailure and the outcome is still produced. Fatal exceptions are not caught and will propagate.

Value parameters

in

the input value

Attributes

Returns

Outcome.Some if this stage produced an output, Outcome.None otherwise

def toEvolution: Evolution[I, O, E]

Lifts this stage into a ConstEvolution that returns it for every status branch.

Lifts this stage into a ConstEvolution that returns it for every status branch.

Useful inside the h8io.stages.cycles operators (h8io.stages.cycles.Loop, h8io.stages.cycles.Repeat, h8io.stages.cycles.Reduce and h8io.stages.cycles.Fold) to produce the evolution embedded in a Yield.

Attributes

def toEvolution(dispose: () => Unit): ConstEvolution[I, O, E]

Lifts this stage into a ConstEvolution that returns it for every status branch and runs dispose when disposed.

Lifts this stage into a ConstEvolution that returns it for every status branch and runs dispose when disposed.

The overload to reach for whenever the lifted stage is not the owner of what has to be released — an operator keeping the inner evolution as the cleanup handle of the generation it has just built, or a stage recovering from an exception with resources still to free.

Value parameters

dispose

the thunk h8io.stages.Evolution.dispose delegates to

Attributes

Concrete fields

val stage: Stage[I, O, E]