Search Results for

    Show / Hide Table of Contents

    Class SwitchableLoggedBehavior<TIn, TOut>

    Test utility to make behavior of functions that return some Task controllable form tests. This tool is able to override default behavior with any generic behavior, including failure, and exposes control to the timing of completion of the associated Task. The utility is implemented as a stack of behaviors, where the behavior on the top of the stack represents the currently active behavior. The bottom of the stack always contains the DefaultBehavior which can not be popped out.

    Inheritance
    object
    SwitchableLoggedBehavior<TIn, TOut>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Remote.Transport
    Assembly: Akka.Remote.dll
    Syntax
    public class SwitchableLoggedBehavior<TIn, TOut>
    Type Parameters
    Name Description
    TIn

    Input type

    TOut

    Output type

    Constructors

    | Edit this page View Source

    SwitchableLoggedBehavior(Func<TIn, Task<TOut>>, Action<TIn>)

    TBD

    Declaration
    public SwitchableLoggedBehavior(Func<TIn, Task<TOut>> defaultBehavior, Action<TIn> logCallback)
    Parameters
    Type Name Description
    Func<TIn, Task<TOut>> defaultBehavior

    TBD

    Action<TIn> logCallback

    TBD

    Properties

    | Edit this page View Source

    CurrentBehavior

    Declaration
    public Func<TIn, Task<TOut>> CurrentBehavior { get; }
    Property Value
    Type Description
    Func<TIn, Task<TOut>>
    | Edit this page View Source

    DefaultBehavior

    Declaration
    public Func<TIn, Task<TOut>> DefaultBehavior { get; }
    Property Value
    Type Description
    Func<TIn, Task<TOut>>
    | Edit this page View Source

    LogCallback

    Declaration
    public Action<TIn> LogCallback { get; }
    Property Value
    Type Description
    Action<TIn>

    Methods

    | Edit this page View Source

    Apply(TIn)

    Declaration
    public Task<TOut> Apply(TIn param)
    Parameters
    Type Name Description
    TIn param
    Returns
    Type Description
    Task<TOut>
    | Edit this page View Source

    Pop()

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

    Push(Func<TIn, Task<TOut>>)

    Changes the current behavior to the provided one

    Declaration
    public void Push(Func<TIn, Task<TOut>> behavior)
    Parameters
    Type Name Description
    Func<TIn, Task<TOut>> behavior

    Function that takes a parameter type TIn and returns a Task TOut.

    | Edit this page View Source

    PushConstant(TOut)

    Changes the behavior to return a completed Task with the given constant value.

    Declaration
    public void PushConstant(TOut result)
    Parameters
    Type Name Description
    TOut result

    The constant the Task will be completed with.

    | Edit this page View Source

    PushDelayed()

    Enables control of the completion of the previously active behavior. Wraps the previous behavior in

    Declaration
    public TaskCompletionSource<bool> PushDelayed()
    Returns
    Type Description
    TaskCompletionSource<bool>

    TBD

    | Edit this page View Source

    PushError(Exception)

    Changes the behavior to return a faulted Task with the given exception

    Declaration
    public void PushError(Exception e)
    Parameters
    Type Name Description
    Exception e

    The exception responsible for faulting this task

    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