Package akka.stream.scaladsl
Class SourceWithContext<Out,Ctx,Mat>
- java.lang.Object
-
- akka.stream.GraphDelegate<SourceShape<scala.Tuple2<Out,Ctx>>,Mat>
-
- akka.stream.scaladsl.SourceWithContext<Out,Ctx,Mat>
-
- All Implemented Interfaces:
Graph<SourceShape<scala.Tuple2<Out,Ctx>>,Mat>
,FlowWithContextOps<Out,Ctx,Mat>
public final class SourceWithContext<Out,Ctx,Mat> extends GraphDelegate<SourceShape<scala.Tuple2<Out,Ctx>>,Mat> implements FlowWithContextOps<Out,Ctx,Mat>
Context-preserving variant ofakka.stream.scaladsl.Source.withAttributes
.- See Also:
akka.stream.scaladsl.Source.withAttributes
-
-
Constructor Summary
Constructors Constructor Description SourceWithContext(Source<scala.Tuple2<Out,Ctx>,Mat> delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <JOut,JCtx,JMat>
SourceWithContext<JOut,JCtx,JMat>asJava()
Source<scala.Tuple2<Out,Ctx>,Mat>
asSource()
Stops automatic context propagation from here and converts this to a regular stream of a pair of (data, context).static <Out,CtxOut,Mat>
SourceWithContext<Out,CtxOut,Mat>fromTuples(Source<scala.Tuple2<Out,CtxOut>,Mat> source)
<Mat2> SourceWithContext<Out,Ctx,Mat2>
mapMaterializedValue(scala.Function1<Mat,Mat2> f)
Context-preserving variant ofakka.stream.scaladsl.Source.mapMaterializedValue
.<Mat2> Mat2
runWith(Graph<SinkShape<scala.Tuple2<Out,Ctx>>,Mat2> sink, Materializer materializer)
Connect thisSourceWithContext
to aSink
and run it.<Mat2> RunnableGraph<Mat>
to(Graph<SinkShape<scala.Tuple2<Out,Ctx>>,Mat2> sink)
Connect thisSourceWithContext
to aSink
, concatenating the processing steps of both.<Mat2,Mat3>
RunnableGraph<Mat3>toMat(Graph<SinkShape<scala.Tuple2<Out,Ctx>>,Mat2> sink, scala.Function2<Mat,Mat2,Mat3> combine)
Connect thisSourceWithContext
to aSink
, concatenating the processing steps of both.<Out2,Ctx2,Mat2>
SourceWithContext<Out2,Ctx2,Mat>via(Graph<FlowShape<scala.Tuple2<Out,Ctx>,scala.Tuple2<Out2,Ctx2>>,Mat2> viaFlow)
Transform this flow by the regular flow.<Out2,Ctx2,Mat2,Mat3>
SourceWithContext<Out2,Ctx2,Mat3>viaMat(Graph<FlowShape<scala.Tuple2<Out,Ctx>,scala.Tuple2<Out2,Ctx2>>,Mat2> flow, scala.Function2<Mat,Mat2,Mat3> combine)
Transform this flow by the regular flow.SourceWithContext<Out,Ctx,Mat>
withAttributes(Attributes attr)
Context-preserving variant ofakka.stream.scaladsl.Source.withAttributes
.-
Methods inherited from class akka.stream.GraphDelegate
shape, traversalBuilder
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface akka.stream.scaladsl.FlowWithContextOps
collect, filter, filterNot, flow, grouped, log, log$default$2, log$default$3, map, mapAsync, mapConcat, mapContext, sliding, sliding$default$2
-
-
-
-
Method Detail
-
fromTuples
public static <Out,CtxOut,Mat> SourceWithContext<Out,CtxOut,Mat> fromTuples(Source<scala.Tuple2<Out,CtxOut>,Mat> source)
-
via
public <Out2,Ctx2,Mat2> SourceWithContext<Out2,Ctx2,Mat> via(Graph<FlowShape<scala.Tuple2<Out,Ctx>,scala.Tuple2<Out2,Ctx2>>,Mat2> viaFlow)
Description copied from interface:FlowWithContextOps
Transform this flow by the regular flow. The given flow must support manual context propagation by taking and producing tuples of (data, context).This can be used as an escape hatch for operations that are not (yet) provided with automatic context propagation here.
- Specified by:
via
in interfaceFlowWithContextOps<Out,Ctx,Mat>
- Parameters:
viaFlow
- (undocumented)- Returns:
- (undocumented)
- See Also:
akka.stream.scaladsl.FlowOps.via
-
viaMat
public <Out2,Ctx2,Mat2,Mat3> SourceWithContext<Out2,Ctx2,Mat3> viaMat(Graph<FlowShape<scala.Tuple2<Out,Ctx>,scala.Tuple2<Out2,Ctx2>>,Mat2> flow, scala.Function2<Mat,Mat2,Mat3> combine)
Description copied from interface:FlowWithContextOps
Transform this flow by the regular flow. The given flow must support manual context propagation by taking and producing tuples of (data, context).This can be used as an escape hatch for operations that are not (yet) provided with automatic context propagation here.
The
combine
function is used to compose the materialized values of this flow and that flow into the materialized value of the resulting Flow.- Specified by:
viaMat
in interfaceFlowWithContextOps<Out,Ctx,Mat>
- Parameters:
flow
- (undocumented)combine
- (undocumented)- Returns:
- (undocumented)
- See Also:
akka.stream.scaladsl.FlowOpsMat.viaMat
-
withAttributes
public SourceWithContext<Out,Ctx,Mat> withAttributes(Attributes attr)
Context-preserving variant ofakka.stream.scaladsl.Source.withAttributes
.- Specified by:
withAttributes
in interfaceGraph<Out,Ctx>
- Parameters:
attr
- (undocumented)- Returns:
- (undocumented)
- See Also:
akka.stream.scaladsl.Source.withAttributes
-
mapMaterializedValue
public <Mat2> SourceWithContext<Out,Ctx,Mat2> mapMaterializedValue(scala.Function1<Mat,Mat2> f)
Context-preserving variant ofakka.stream.scaladsl.Source.mapMaterializedValue
.- Parameters:
f
- (undocumented)- Returns:
- (undocumented)
- See Also:
akka.stream.scaladsl.Source.mapMaterializedValue
-
to
public <Mat2> RunnableGraph<Mat> to(Graph<SinkShape<scala.Tuple2<Out,Ctx>>,Mat2> sink)
Connect thisSourceWithContext
to aSink
, concatenating the processing steps of both.- Parameters:
sink
- (undocumented)- Returns:
- (undocumented)
-
toMat
public <Mat2,Mat3> RunnableGraph<Mat3> toMat(Graph<SinkShape<scala.Tuple2<Out,Ctx>>,Mat2> sink, scala.Function2<Mat,Mat2,Mat3> combine)
Connect thisSourceWithContext
to aSink
, concatenating the processing steps of both.- Parameters:
sink
- (undocumented)combine
- (undocumented)- Returns:
- (undocumented)
-
runWith
public <Mat2> Mat2 runWith(Graph<SinkShape<scala.Tuple2<Out,Ctx>>,Mat2> sink, Materializer materializer)
Connect thisSourceWithContext
to aSink
and run it. The returned value is the materialized value of theSink
.- Parameters:
sink
- (undocumented)materializer
- (undocumented)- Returns:
- (undocumented)
-
asSource
public Source<scala.Tuple2<Out,Ctx>,Mat> asSource()
Stops automatic context propagation from here and converts this to a regular stream of a pair of (data, context).- Returns:
- (undocumented)
-
asJava
public <JOut,JCtx,JMat> SourceWithContext<JOut,JCtx,JMat> asJava()
-
-