SafeStage
A h8io.stages.Stage that separates normal execution from exception recovery.
SafeStage seals apply and dispatches to body for the happy path. If body throws a non-fatal exception (anything matched by scala.util.control.NonFatal), recover is called instead. Fatal exceptions (e.g., OutOfMemoryError) are not caught and propagate normally.
Concrete classes implement body for the normal case and recover to convert exceptions into an appropriate h8io.stages.Yield (typically a h8io.stages.Yield.None with an error status).
Type parameters
- E
-
the error type (covariant)
- I
-
the input type (contravariant)
- O
-
the output type (covariant)
Attributes
- Graph
-
- Supertypes
- Known subtypes
-
Members list
Value members
Abstract methods
The main execution logic invoked on each input.
The main execution logic invoked on each input.
Value parameters
- in
-
the input value
Attributes
- Returns
-
a
h8io.stages.Yieldrepresenting the result
Concrete methods
Processes in and returns the Yield carrying the optional output, the status and the continuation.
Inherited methods
Composes two instances of Function1 in a new Function1, with this function applied first.
Composes two instances of Function1 in a new Function1, with this function applied first.
Type parameters
- A
-
the result type of function
g
Value parameters
- g
-
a function R => A
Attributes
- Returns
-
a new function
fsuch thatf(x) == g(apply(x)) - Inherited from:
- Function1
Composes two instances of Function1 in a new Function1, with this function applied last.
Composes two instances of Function1 in a new Function1, with this function applied last.
Type parameters
- A
-
the type to which function
gcan be applied
Value parameters
- g
-
a function A => T1
Attributes
- Returns
-
a new function
fsuch thatf(x) == apply(g(x)) - Inherited from:
- Function1
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
Function1 -> Any
- Inherited from:
- Function1
Composes this stage with that, feeding this stage's output into it. See the ''Composition'' section above for what happens when there is no output to feed.
Composes this stage with that, feeding this stage's output into it. See the ''Composition'' section above for what happens when there is no output to feed.
Attributes
- Inherited from:
- Stage
Inherited and Abstract methods
Returns this stage's Evolution without consuming an input.
Returns this stage's Evolution without consuming an input.
Called instead of apply whenever the stage takes part in a run but has nothing to process: the upstream yielded no output, or a binary operator excluded this branch. The evolution must be the one the stage would have returned had it run. Like apply, skip() may perform side effects — a decorator, for instance, may advance or release the inner stage it owns.
Attributes
- Inherited from:
- Stage