Search Results for

    Show / Hide Table of Contents

    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
    object
    GraphDelegate<SourceShape<(TOut, TCtx)>, TMat>
    SourceWithContext<TOut, TCtx, TMat>
    Implements
    IGraph<SourceShape<(TOut, TCtx)>, TMat>
    IGraph<SourceShape<(TOut, TCtx)>>
    Inherited Members
    GraphDelegate<SourceShape<(TOut, TCtx)>, TMat>.Shape
    GraphDelegate<SourceShape<(TOut, TCtx)>, TMat>.Module
    GraphDelegate<SourceShape<(TOut, TCtx)>, TMat>.WithAttributes(Attributes)
    GraphDelegate<SourceShape<(TOut, TCtx)>, TMat>.AddAttributes(Attributes)
    GraphDelegate<SourceShape<(TOut, TCtx)>, TMat>.Named(string)
    GraphDelegate<SourceShape<(TOut, TCtx)>, TMat>.Async()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Streams.Dsl
    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

    | Edit this page View Source

    SourceWithContext(Source<(TOut, TCtx), TMat>)

    Declaration
    public SourceWithContext(Source<(TOut, TCtx), TMat> source)
    Parameters
    Type Name Description
    Source<(TOut, TCtx), TMat> source

    Methods

    | Edit this page 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<(TOut, TCtx), TMat>
    | Edit this page View Source

    MapMaterializedValue<TMat2>(Func<TMat, TMat2>)

    Context-preserving variant of 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 Description
    SourceWithContext<TOut, TCtx, TMat2>
    Type Parameters
    Name Description
    TMat2
    | Edit this page 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
    Type Name Description
    IGraph<SinkShape<(TOut, TCtx)>, TMat2> sink
    IMaterializer materializer
    Returns
    Type Description
    TMat2
    Type Parameters
    Name Description
    TMat2
    | Edit this page View Source

    ToMaterialized<TMat2, TMat3>(IGraph<SinkShape<(TOut, TCtx)>, TMat2>, Func<TMat, TMat2, TMat3>)

    Connect this SourceWithContext<TOut, TCtx, TMat> to a Sink, concatenating the processing steps of both.

    Declaration
    public IRunnableGraph<TMat3> ToMaterialized<TMat2, TMat3>(IGraph<SinkShape<(TOut, TCtx)>, TMat2> sink, Func<TMat, TMat2, TMat3> combine)
    Parameters
    Type Name Description
    IGraph<SinkShape<(TOut, TCtx)>, TMat2> sink
    Func<TMat, TMat2, TMat3> combine
    Returns
    Type Description
    IRunnableGraph<TMat3>
    Type Parameters
    Name Description
    TMat2
    TMat3
    | Edit this page View Source

    To<TMat2>(IGraph<SinkShape<(TOut, TCtx)>, TMat2>)

    Connect this SourceWithContext<TOut, TCtx, TMat> to a Sink, concatenating the processing steps of both.

    Declaration
    public IRunnableGraph<TMat> To<TMat2>(IGraph<SinkShape<(TOut, TCtx)>, TMat2> sink)
    Parameters
    Type Name Description
    IGraph<SinkShape<(TOut, TCtx)>, TMat2> sink
    Returns
    Type Description
    IRunnableGraph<TMat>
    Type Parameters
    Name Description
    TMat2
    | Edit this page 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<(TOut, TCtx), (TOut2, TCtx2)>, TMat2> viaFlow
    Func<TMat, TMat2, TMat3> combine
    Returns
    Type Description
    SourceWithContext<TOut2, TCtx2, TMat3>
    Type Parameters
    Name Description
    TOut2
    TCtx2
    TMat2
    TMat3
    | Edit this page 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<(TOut, TCtx), (TOut2, TCtx2)>, TMat2> viaFlow
    Returns
    Type Description
    SourceWithContext<TOut2, TCtx2, TMat>
    Type Parameters
    Name Description
    TOut2
    TCtx2
    TMat2

    Implements

    IGraph<TShape, TMaterialized>
    IGraph<TShape>

    Extension Methods

    SourceWithContextOperations.Collect<TOut, TCtx, TOut2, TMat>(SourceWithContext<TOut, TCtx, TMat>, Func<TOut, TOut2>)
    SourceWithContextOperations.Grouped<TOut, TCtx, TMat>(SourceWithContext<TOut, TCtx, TMat>, int)
    SourceWithContextOperations.SelectAsync<TOut, TCtx, TOut2, TMat>(SourceWithContext<TOut, TCtx, TMat>, int, Func<TOut, Task<TOut2>>)
    SourceWithContextOperations.SelectConcat<TOut, TCtx, TOut2, TMat>(SourceWithContext<TOut, TCtx, TMat>, Func<TOut, IEnumerable<TOut2>>)
    SourceWithContextOperations.SelectContext<TOut, TCtx, TCtx2, TMat>(SourceWithContext<TOut, TCtx, TMat>, Func<TCtx, TCtx2>)
    SourceWithContextOperations.Select<TOut, TCtx, TOut2, TMat>(SourceWithContext<TOut, TCtx, TMat>, Func<TOut, TOut2>)
    SourceWithContextOperations.Sliding<TOut, TCtx, TMat>(SourceWithContext<TOut, TCtx, TMat>, int, int)
    SourceWithContextOperations.StatefulSelectConcat<TOut, TCtx, TOut2, TMat>(SourceWithContext<TOut, TCtx, TMat>, Func<Func<TOut, IEnumerable<TOut2>>>)
    SourceWithContextOperations.WhereNot<TOut, TCtx, TMat>(SourceWithContext<TOut, TCtx, TMat>, Func<TOut, bool>)
    SourceWithContextOperations.Where<TOut, TCtx, TMat>(SourceWithContext<TOut, TCtx, TMat>, Func<TOut, bool>)
    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET