Class SourceWithContext<TOut, TCtx, TMat>
A source that provides operations which automatically propagate the context of an element.
Only a subset of common operations from FlowOperations is supported. As an escape hatch you can
use [[FlowWithContextOps.via]] to manually provide the context propagation for otherwise unsupported
operations.
Inheritance
SourceWithContext<TOut, TCtx, TMat>
Assembly: Akka.Streams.dll
Syntax
public sealed class SourceWithContext<TOut, TCtx, TMat> : GraphDelegate<SourceShape<(TOut, TCtx)>, TMat>, IGraph<SourceShape<(TOut, TCtx)>, TMat>, IGraph<SourceShape<(TOut, TCtx)>>
Type Parameters
Name |
Description |
TOut |
|
TCtx |
|
TMat |
|
Constructors
|
Improve this Doc
View Source
SourceWithContext(Source<(TOut, TCtx), TMat>)
Declaration
public SourceWithContext(Source<(TOut, TCtx), TMat> source)
Parameters
Type |
Name |
Description |
Source<System.ValueTuple<TOut, TCtx>, TMat> |
source |
|
Methods
|
Improve this Doc
View Source
AsSource()
Stops automatic context propagation from here and converts this to a regular
stream of a pair of (data, context).
Declaration
public Source<(TOut, TCtx), TMat> AsSource()
Returns
Type |
Description |
Source<System.ValueTuple<TOut, TCtx>, TMat> |
|
|
Improve this Doc
View Source
MapMaterializedValue<TMat2>(Func<TMat, TMat2>)
Declaration
public SourceWithContext<TOut, TCtx, TMat2> MapMaterializedValue<TMat2>(Func<TMat, TMat2> combine)
Parameters
Type |
Name |
Description |
Func<TMat, TMat2> |
combine |
|
Returns
Type Parameters
|
Improve this Doc
View Source
RunWith<TMat2>(IGraph<SinkShape<(TOut, TCtx)>, TMat2>, IMaterializer)
Connect this SourceWithContext<TOut, TCtx, TMat> to a Sink and run it. The returned value is the materialized value of the Sink.
Note that the ActorSystem can be used as the implicit materializer parameter to use the SystemMaterializer for running the stream.
Declaration
public TMat2 RunWith<TMat2>(IGraph<SinkShape<(TOut, TCtx)>, TMat2> sink, IMaterializer materializer)
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
To<TMat2>(IGraph<SinkShape<(TOut, TCtx)>, TMat2>)
Declaration
public IRunnableGraph<TMat> To<TMat2>(IGraph<SinkShape<(TOut, TCtx)>, TMat2> sink)
Parameters
Type |
Name |
Description |
IGraph<SinkShape<System.ValueTuple<TOut, TCtx>>, TMat2> |
sink |
|
Returns
Type Parameters
|
Improve this Doc
View Source
ToMaterialized<TMat2, TMat3>(IGraph<SinkShape<(TOut, TCtx)>, TMat2>, Func<TMat, TMat2, TMat3>)
Declaration
public IRunnableGraph<TMat3> ToMaterialized<TMat2, TMat3>(IGraph<SinkShape<(TOut, TCtx)>, TMat2> sink, Func<TMat, TMat2, TMat3> combine)
Parameters
Type |
Name |
Description |
IGraph<SinkShape<System.ValueTuple<TOut, TCtx>>, TMat2> |
sink |
|
Func<TMat, TMat2, TMat3> |
combine |
|
Returns
Type Parameters
Name |
Description |
TMat2 |
|
TMat3 |
|
|
Improve this Doc
View Source
Via<TOut2, TCtx2, TMat2>(IGraph<FlowShape<(TOut, TCtx), (TOut2, TCtx2)>, TMat2>)
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.
Declaration
public SourceWithContext<TOut2, TCtx2, TMat> Via<TOut2, TCtx2, TMat2>(IGraph<FlowShape<(TOut, TCtx), (TOut2, TCtx2)>, TMat2> viaFlow)
Parameters
Type |
Name |
Description |
IGraph<FlowShape<System.ValueTuple<TOut, TCtx>, System.ValueTuple<TOut2, TCtx2>>, TMat2> |
viaFlow |
|
Returns
Type Parameters
Name |
Description |
TOut2 |
|
TCtx2 |
|
TMat2 |
|
|
Improve this Doc
View Source
ViaMaterialized<TOut2, TCtx2, TMat2, TMat3>(IGraph<FlowShape<(TOut, TCtx), (TOut2, TCtx2)>, TMat2>, Func<TMat, TMat2, TMat3>)
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.
Declaration
public SourceWithContext<TOut2, TCtx2, TMat3> ViaMaterialized<TOut2, TCtx2, TMat2, TMat3>(IGraph<FlowShape<(TOut, TCtx), (TOut2, TCtx2)>, TMat2> viaFlow, Func<TMat, TMat2, TMat3> combine)
Parameters
Type |
Name |
Description |
IGraph<FlowShape<System.ValueTuple<TOut, TCtx>, System.ValueTuple<TOut2, TCtx2>>, TMat2> |
viaFlow |
|
Func<TMat, TMat2, TMat3> |
combine |
|
Returns
Type Parameters
Name |
Description |
TOut2 |
|
TCtx2 |
|
TMat2 |
|
TMat3 |
|
Implements
Extension Methods