Search Results for

    Show / Hide Table of Contents

    Class SharedKillSwitch

    A SharedKillSwitch is a provider for IGraph<TShape>s of FlowShape<TIn, TOut> that can be completed or failed from the outside.

    A IGraph<TShape> returned by the switch can be materialized arbitrary amount of times: every newly materializedIGraph<TShape> belongs to the switch from which it was acquired. Multiple SharedKillSwitch instances are isolated from each other, shutting down or aborting on instance does not affect the IGraph<TShape>s provided by another instance.

    After calling Shutdown() all materialized, running instances of all IGraph<TShape>s provided by the SharedKillSwitch will complete their downstreams and cancel their upstreams(unless if finished or failed already in which case the command is ignored). Subsequent invocations of Shutdown() and Abort(Exception) will be ignored.

    After calling Abort(Exception) all materialized, running instances of all IGraph<TShape>s provided by the SharedKillSwitch will fail their downstreams with the provided exception and cancel their upstreams (unless it finished or failed already in which case the command is ignored). Subsequent invocations of Shutdown() and Abort(Exception) will be ignored.

    The IGraph<TShape>s provided by the SharedKillSwitch do not modify the passed through elements in any way or affect backpressure in the stream. All provided IGraph<TShape>s provide the parent SharedKillSwitch as materialized value.

    This class is thread-safe, the instance can be passed safely among threads and its methods may be invoked concurrently.

    Inheritance
    object
    SharedKillSwitch
    Implements
    IKillSwitch
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Akka.Streams
    Assembly: Akka.Streams.dll
    Syntax
    public sealed class SharedKillSwitch : IKillSwitch

    Methods

    | Edit this page View Source

    Abort(Exception)

    After calling Abort(Exception) all materialized, running instances of all IGraph<TShape>s provided by the SharedKillSwitch will fail their downstreams with the provided exception and cancel their upstreams (unless it finished or failed already in which case the command is ignored). Subsequent invocations of Shutdown() and Abort(Exception) will be ignored.

    These provided IGraph<TShape>s materialize to their owning switch. This might make certain integrations simpler than passing around the switch instance itself.

    Declaration
    public void Abort(Exception cause)
    Parameters
    Type Name Description
    Exception cause

    The exception to be used for failing the linked IGraph<TShape>s

    | Edit this page View Source

    Flow<T>()

    Returns a typed Flow of a requested type that will be linked to this SharedKillSwitch instance. By invoking Shutdown() or Abort(Exception) all running instances of all provided IGraph<TShape>s by this switch will be stopped normally or failed.

    Declaration
    public IGraph<FlowShape<T, T>, SharedKillSwitch> Flow<T>()
    Returns
    Type Description
    IGraph<FlowShape<T, T>, SharedKillSwitch>

    A reusable IGraph<TShape> that is linked with the switch. The materialized value provided is this switch itself.

    Type Parameters
    Name Description
    T

    Type of the elements the Flow will forward

    | Edit this page View Source

    Shutdown()

    After calling Shutdown() all materialized, running instances of all IGraph<TShape>s provided by the SharedKillSwitch will complete their downstreams and cancel their upstreams (unless if finished or failed already in which case the command is ignored). Subsequent invocations of Shutdown() and Abort(Exception) will be ignored.

    Declaration
    public void Shutdown()
    | Edit this page View Source

    ToString()

    TBD

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    TBD

    Overrides
    object.ToString()

    Implements

    IKillSwitch

    Extension Methods

    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