| TestKitBaseTryReceiveOne Method (MessageEnvelope, NullableTimeSpan, CancellationToken) |
Receive one message from the internal queue of the TestActor within
the specified duration.
True is returned if a message existed, and the message
is returned in envelope. The method blocks the
specified duration, and can be cancelled using the
cancellationToken.
Remarks This method does NOT automatically scale its duration parameter using
Dilated(TimeSpan)!
Namespace:
Akka.TestKit
Assembly:
Akka.TestKit (in Akka.TestKit.dll) Version: 1.2.3.129 (1.2.3.129)
Syntax public bool TryReceiveOne(
out MessageEnvelope envelope,
Nullable<TimeSpan> max,
CancellationToken cancellationToken
)
member TryReceiveOne :
envelope : MessageEnvelope byref *
max : Nullable<TimeSpan> *
cancellationToken : CancellationToken -> bool
Parameters
- envelope
- Type: Akka.TestKitMessageEnvelope
The received envelope. - max
- Type: SystemNullableTimeSpan
The maximum duration to wait.
If null the config value "akka.test.single-expect-default" is used as timeout.
If set to InfiniteTimeSpan, blocks forever (or until cancelled).
Remarks This method does NOT automatically scale its Duration parameter using
Dilated(TimeSpan)!
- cancellationToken
- Type: System.ThreadingCancellationToken
A token used to cancel the operation.
Return Value
Type:
BooleanTrue if a message was received within the specified duration;
false otherwise.
See Also