removing replySafe and replyUnsafe in favor of the unified reply/tryReply
This commit is contained in:
parent
4258abfc9f
commit
b23a8fffeb
20 changed files with 54 additions and 74 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue