Package akka.stream.scaladsl
Class OrElse<T>
- java.lang.Object
-
- akka.stream.stage.GraphStageWithMaterializedValue<S,NotUsed>
-
- akka.stream.stage.GraphStage<UniformFanInShape<T,T>>
-
- akka.stream.scaladsl.OrElse<T>
-
- All Implemented Interfaces:
Graph<UniformFanInShape<T,T>,NotUsed>
public final class OrElse<T> extends GraphStage<UniformFanInShape<T,T>>
Takes two streams and passes the first through, the secondary stream is only passed through if the primary stream completes without passing any elements through. When the first element is passed through from the primary the secondary is cancelled. Both incoming streams are materialized when the operator is materialized.On errors the operator is failed regardless of source of the error.
'''Emits when''' element is available from primary stream or the primary stream closed without emitting any elements and an element is available from the secondary stream
'''Backpressures when''' downstream backpressures
'''Completes when''' the primary stream completes after emitting at least one element, when the primary stream completes without emitting and the secondary stream already has completed or when the secondary stream completes
'''Cancels when''' downstream cancels
-
-
Constructor Summary
Constructors Constructor Description OrElse()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> OrElse<T>
apply()
GraphStageLogic
createLogic(Attributes inheritedAttributes)
protected Attributes
initialAttributes()
Outlet<T>
out()
Inlet<T>
primary()
Inlet<T>
secondary()
UniformFanInShape<T,T>
shape()
The shape of a graph is all that is externally visible: its inlets and outlets.java.lang.String
toString()
-
Methods inherited from class akka.stream.stage.GraphStage
createLogicAndMaterializedValue
-
Methods inherited from class akka.stream.stage.GraphStageWithMaterializedValue
createLogicAndMaterializedValue, traversalBuilder, withAttributes
-
-
-
-
Method Detail
-
shape
public UniformFanInShape<T,T> shape()
Description copied from interface:Graph
The shape of a graph is all that is externally visible: its inlets and outlets.- Returns:
- (undocumented)
-
initialAttributes
protected Attributes initialAttributes()
- Overrides:
initialAttributes
in classGraphStageWithMaterializedValue<UniformFanInShape<T,T>,NotUsed>
-
createLogic
public GraphStageLogic createLogic(Attributes inheritedAttributes)
- Specified by:
createLogic
in classGraphStage<UniformFanInShape<T,T>>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-