Renaming sendOneWay to tell, closing ticket #1072
This commit is contained in:
parent
29ca6a867b
commit
04729bcbc3
32 changed files with 94 additions and 94 deletions
|
|
@ -117,14 +117,14 @@ public class Pi {
|
|||
if (message instanceof Calculate) {
|
||||
// schedule work
|
||||
for (int start = 0; start < nrOfMessages; start++) {
|
||||
router.sendOneWay(new Work(start, nrOfElements), getContext());
|
||||
router.tell(new Work(start, nrOfElements), getContext());
|
||||
}
|
||||
|
||||
// send a PoisonPill to all workers telling them to shut down themselves
|
||||
router.sendOneWay(new Broadcast(poisonPill()));
|
||||
router.tell(new Broadcast(poisonPill()));
|
||||
|
||||
// send a PoisonPill to the router, telling him to shut himself down
|
||||
router.sendOneWay(poisonPill());
|
||||
router.tell(poisonPill());
|
||||
|
||||
} else if (message instanceof Result) {
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ public class Pi {
|
|||
}, "master").start();
|
||||
|
||||
// start the calculation
|
||||
master.sendOneWay(new Calculate());
|
||||
master.tell(new Calculate());
|
||||
|
||||
// wait for master to shut down
|
||||
latch.await();
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ public class Pi {
|
|||
public void apply(Object msg) {
|
||||
// schedule work
|
||||
for (int arg = 0; arg < nrOfMessages; arg++) {
|
||||
router.sendOneWay(new Work(arg, nrOfElements), getContext());
|
||||
router.tell(new Work(arg, nrOfElements), getContext());
|
||||
}
|
||||
// Assume the gathering behavior
|
||||
become(gather(getContext().getChannel()));
|
||||
|
|
@ -135,7 +135,7 @@ public class Pi {
|
|||
nrOfResults += 1;
|
||||
if (nrOfResults == nrOfMessages) {
|
||||
// send the pi result back to the guy who started the calculation
|
||||
recipient.sendOneWay(pi);
|
||||
recipient.tell(pi);
|
||||
// shut ourselves down, we're done
|
||||
getContext().stop();
|
||||
}
|
||||
|
|
@ -146,9 +146,9 @@ public class Pi {
|
|||
@Override
|
||||
public void postStop() {
|
||||
// send a PoisonPill to all workers telling them to shut down themselves
|
||||
router.sendOneWay(new Broadcast(poisonPill()));
|
||||
router.tell(new Broadcast(poisonPill()));
|
||||
// send a PoisonPill to the router, telling him to shut himself down
|
||||
router.sendOneWay(poisonPill());
|
||||
router.tell(poisonPill());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue