Search Results for

    Show / Hide Table of Contents

    Class ChannelSink

    Inheritance
    object
    ChannelSink
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Streams.Dsl
    Assembly: Akka.Streams.dll
    Syntax
    public static class ChannelSink

    Methods

    | Edit this page View Source

    AsReader<T>(int, bool, BoundedChannelFullMode)

    Creates a sink that upon materialization, returns a ChannelReader<T> connected with this materialized graph. It can then be used to consume events incoming from the graph. It will also be completed once upstream completes.

    Declaration
    public static Sink<T, ChannelReader<T>> AsReader<T>(int bufferSize, bool singleReader = false, BoundedChannelFullMode fullMode = BoundedChannelFullMode.Wait)
    Parameters
    Type Name Description
    int bufferSize
    bool singleReader
    BoundedChannelFullMode fullMode
    Returns
    Type Description
    Sink<T, ChannelReader<T>>
    Type Parameters
    Name Description
    T
    | Edit this page View Source

    FromWriter<T>(ChannelWriter<T>, bool)

    Creates a Sink that will emit incoming events directly into the provided ChannelWriter<T>. It will handle backpressure automatically by respecting the channel's capacity.

    Declaration
    public static Sink<T, NotUsed> FromWriter<T>(ChannelWriter<T> writer, bool isOwner)
    Parameters
    Type Name Description
    ChannelWriter<T> writer

    A ChannelWriter<T> to pass events emitted from the materialized graph to.

    bool isOwner

    Determines whether the materialized graph should take ownership of the writer. When true, the sink will call Complete() when the stream completes normally, and TryComplete(Exception) if the stream fails. When false, the sink will not complete the writer, allowing it to be used by multiple producers or managed externally.

    Returns
    Type Description
    Sink<T, NotUsed>

    A Sink<TIn, TMat> that writes to the provided channel.

    Type Parameters
    Name Description
    T

    Type of events passed to writer.

    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