KeepLastOutput
h8io.stages.operators.KeepLastOutput
object KeepLastOutput
A decorator that remembers the last output produced by the inner stage and re-emits it when the inner stage yields no value.
The decorator has two internal states:
Nonestate (initial): no output has been seen yet. The inner stage'sh8io.stages.Yield.Noneis forwarded unchanged; ah8io.stages.Yield.Someis forwarded and transitions the wrapper to theSomestate.Somestate: a previous outputoutis remembered, so the wrapper always emits a value. A newh8io.stages.Yield.Somefrom the inner stage is forwarded as is and updates the remembered value; onh8io.stages.Yield.Nonethe remembered value is emitted instead.
In both states the evolution is mapped so that continuations remain wrapped in the appropriate KeepLastOutput variant, preserving the last-value semantics.
Both variants are internal to the package: the decorator is reached through the KeepLastOutput.apply factory, which always starts in the None state, and the state it is in afterwards is not part of the API.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
KeepLastOutput.type
Members list
In this article