Package org.apache.pekko.http.impl.util
Class CollectorStage<T>
java.lang.Object
org.apache.pekko.stream.stage.GraphStageWithMaterializedValue<org.apache.pekko.stream.SinkShape<T>,Collect<T>>
org.apache.pekko.http.impl.util.CollectorStage<T>
- All Implemented Interfaces:
org.apache.pekko.stream.Graph<org.apache.pekko.stream.SinkShape<T>,Collect<T>>
public class CollectorStage<T>
extends org.apache.pekko.stream.stage.GraphStageWithMaterializedValue<org.apache.pekko.stream.SinkShape<T>,Collect<T>>
Stage similar to Sink.seq that provides a side-channel to get at the collection at any point.
It will return all the collected elements and a flag whether the stream was completed or not.
When this is added to a fused flow it can be used to check what output and completion a given input will bring. Because the side-channel will go through the mailbox of the ActorGraphInterpreter the hope is that the fused stream will "run to exhaustion", i.e. it will run as far as it can, so that when the side-channel event is processed, no other (internal) events are still to be processed. This assumption does not hold if the source stream has asynchronous boundaries or components.
TODO: allow multiple rescheduling of AsyncCallback to make it more likely that all internal queues have been processed.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassclassclassclassstatic interfaceState of the callback infrastructureclassNested classes/interfaces inherited from interface org.apache.pekko.stream.Graph
org.apache.pekko.stream.Graph.GraphMapMatVal<S extends org.apache.pekko.stream.Shape,M extends Object> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateLogicAndMaterializedValue(org.apache.pekko.stream.Attributes inheritedAttributes) org.apache.pekko.stream.Inlet<T>in()Accessor for nested Scala objectstatic <T,U> scala.concurrent.Future<scala.Tuple2<scala.collection.immutable.Seq<U>, Object>> resultAfterSourceElements(org.apache.pekko.stream.scaladsl.Source<T, Object> source, org.apache.pekko.stream.scaladsl.Flow<T, U, Object> flow, org.apache.pekko.stream.Materializer materializer) org.apache.pekko.stream.SinkShape<T>shape()Accessor for nested Scala objectMethods inherited from class org.apache.pekko.stream.stage.GraphStageWithMaterializedValue
addAttributes, async, async, async, createLogicAndMaterializedValue, getAttributes, initialAttributes, named, traversalBuilder, withAttributes
-
Constructor Details
-
CollectorStage
public CollectorStage()
-
-
Method Details
-
resultAfterSourceElements
-
Uninitialized
Accessor for nested Scala object- Returns:
- (undocumented)
-
Initialized
Accessor for nested Scala object- Returns:
- (undocumented)
-
in
-
shape
-
createLogicAndMaterializedValue
-