 | TestKitBaseTryReceiveOne Method (MessageEnvelope, NullableTimeSpan) |
Receive one message from the internal queue of the TestActor within
the specified duration. The method blocks the specified duration.
RemarksNote! that the returned
envelope
is a
MessageEnvelope containing the sender and the message.
RemarksThis 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.42 (1.2.3.42)
Syntaxpublic bool TryReceiveOne(
out MessageEnvelope envelope,
Nullable<TimeSpan> max = null
)
member TryReceiveOne :
envelope : MessageEnvelope byref *
?max : Nullable<TimeSpan>
(* Defaults:
let _max = defaultArg max null
*)
-> bool
Parameters
- envelope
- Type: Akka.TestKitMessageEnvelope
The received envelope. - max (Optional)
- Type: SystemNullableTimeSpan
Optional: The maximum duration to wait.
If null the config value "akka.test.single-expect-default" is used as timeout.
If set to a negative value or InfiniteTimeSpan, blocks forever.
RemarksThis method does NOT automatically scale its Duration parameter using
Dilated(TimeSpan)!
Return Value
Type:
BooleanTrue if a message was received within the specified duration;
false otherwise.
See Also