In the Akka Scala API you can call receiveWhile to receive messages sent to
a TestProbe:
val msgs = testProbe.receiveWhile(5.seconds) {
case x *=> ...*
}
In the Java API you can do something similar, but I could not find a way to
use ReceiveWhile with a TestProbe:
final CurrentState[] msgs =
new ReceiveWhile<CurrentState>(CurrentState.class, duration("5 seconds")) {
protected CurrentState match(Object in) {
if (in instanceof CurrentState) {
CurrentState cs = (CurrentState) in;
// ...
return cs;
}
throw noMatch();
}
}.get(); // this extracts the received messages
Is there a way to do this in the Java API where the messages are sent to a
TestProbe?
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.