removing replySafe and replyUnsafe in favor of the unified reply/tryReply

This commit is contained in:
Viktor Klang 2011-07-20 15:58:28 +02:00
parent 4258abfc9f
commit b23a8fffeb
20 changed files with 54 additions and 74 deletions

View file

@ -20,7 +20,7 @@ Step 1: Define the Actor
public class SerializationTestActor extends UntypedActor {
public void onReceive(Object msg) {
getContext().replySafe("got it!");
getContext().tryReply("got it!");
}
}
@ -101,10 +101,10 @@ Step 1: Define the Actor
public void onReceive(Object msg) {
if (msg.equals("hello")) {
count = count + 1;
getContext().replyUnsafe("world " + count);
getContext().reply("world " + count);
} else if (msg instanceof String) {
count = count + 1;
getContext().replyUnsafe("hello " + msg + " " + count);
getContext().reply("hello " + msg + " " + count);
} else {
throw new IllegalArgumentException("invalid message type");
}