Click or drag to resize
Akka.NETTestLatch Class

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 Hierarchy
SystemObject
  Akka.TestKitTestLatch

Namespace:  Akka.TestKit
Assembly:  Akka.TestKit (in Akka.TestKit.dll) Version: 1.2.3.42 (1.2.3.42)
Syntax
public class TestLatch

The TestLatch type exposes the following members.

Constructors
  NameDescription
Public methodTestLatch
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.
Public methodTestLatch(Int32)
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.
Public methodTestLatch(Int32, 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.
Protected methodTestLatch(FuncTimeSpan, TimeSpan, TimeSpan, Int32)
TBD
Top
Properties
  NameDescription
Public propertyIsOpen
Gets a value indicating whether the latch is open.
Top
Methods
  NameDescription
Public methodCountDown
Count down the latch.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOpen
Make this instance become open.
Public methodReady
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

Public methodReady(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.CreateTestLatchtimeout is dilated, i.e. multiplied by TestTimeFactor

Public methodReset
Reset this instance to the initial count, making it become closed.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldStatic memberDefaultTimeout Obsolete.
Obsolete. This field will be removed. DefaultTimeout is an alternative.
Top
Extension Methods
See Also