Search Results for

    Show / Hide Table of Contents

    Class TestLatch

    A count down latch that initially is closed. In order for it to become open CountDown() must be called. By default one call is enough, but this can be changed by specifying the count in the constructor.

    By default a timeout of 5 seconds is used.

    When created using TestKit.CreateTestLatch the default timeout from DefaultTimeout is used and all timeouts are dilated, i.e. multiplied by TestTimeFactor

    Timeouts will always throw an exception.
    Inheritance
    object
    TestLatch
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.TestKit
    Assembly: Akka.TestKit.dll
    Syntax
    public class TestLatch

    Constructors

    | Edit this page View Source

    TestLatch()

    Initializes a new instance of the TestLatch class with count = 1, i.e. the instance will become open after one call to CountDown(). The default timeout is set to 5 seconds.

    Declaration
    public TestLatch()
    | Edit this page View Source

    TestLatch(Func<TimeSpan, TimeSpan>, TimeSpan, int)

    TBD

    Declaration
    protected TestLatch(Func<TimeSpan, TimeSpan> dilate, TimeSpan defaultTimeout, int count)
    Parameters
    Type Name Description
    Func<TimeSpan, TimeSpan> dilate

    TBD

    TimeSpan defaultTimeout

    TBD

    int count

    TBD

    | Edit this page View Source

    TestLatch(int)

    Initializes a new instance of the TestLatch class with the specified count, i.e number of times CountDown() must be called to make this instance become open. The default timeout is set to 5 seconds.

    Declaration
    public TestLatch(int count)
    Parameters
    Type Name Description
    int count

    TBD

    | Edit this page View Source

    TestLatch(int, TimeSpan)

    Initializes a new instance of the TestLatch class with the specified count, i.e number of times CountDown() must be called to make this instance become open.

    Declaration
    public TestLatch(int count, TimeSpan defaultTimeout)
    Parameters
    Type Name Description
    int count

    TBD

    TimeSpan defaultTimeout

    TBD

    Fields

    | Edit this page View Source

    DefaultTimeout

    Obsolete. This field will be removed. DefaultTimeout is an alternative.

    Declaration
    [Obsolete("This field will be removed. TestKitSettings.DefaultTimeout is an alternative.")]
    public static readonly TimeSpan DefaultTimeout
    Field Value
    Type Description
    TimeSpan

    Properties

    | Edit this page View Source

    IsOpen

    Gets a value indicating whether the latch is open.

    Declaration
    public bool IsOpen { get; }
    Property Value
    Type Description
    bool

    Methods

    | Edit this page View Source

    CountDown()

    Count down the latch.

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

    Open()

    Make this instance become open.

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

    Ready()

    Expects the latch to become open within the default timeout. If the timeout is reached, a TimeoutException is thrown.

    If no timeout was specified when creating this instance, 5 seconds is used.

    If this instance has been created using TestKit.CreateTestLatch the default timeout from DefaultTimeout is used and dilated, i.e. multiplied by TestTimeFactor

    Declaration
    public void Ready()
    Exceptions
    Type Condition
    TimeoutException

    This exception is thrown when the timeout is reached.

    | Edit this page View Source

    Ready(TimeSpan)

    Expects the latch to become open within the specified timeout. If the timeout is reached, a TimeoutException is thrown.

    If this instance has been created using TestKit.CreateTestLatch timeout is dilated, i.e. multiplied by TestTimeFactor

    Declaration
    public void Ready(TimeSpan timeout)
    Parameters
    Type Name Description
    TimeSpan timeout

    TBD

    Exceptions
    Type Condition
    ArgumentException

    This exception is thrown when a too large timeout has been specified.

    TimeoutException

    This exception is thrown when the timeout is reached.

    | Edit this page View Source

    Reset()

    Reset this instance to the initial count, making it become closed.

    Declaration
    public void Reset()

    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