Java style accessors for AbstractFSM #22592
This commit is contained in:
parent
363ca39f52
commit
07e88300bc
24 changed files with 85 additions and 58 deletions
|
|
@ -18,7 +18,7 @@ public class FactorialBackend extends AbstractActor {
|
|||
CompletableFuture.supplyAsync(() -> factorial(n))
|
||||
.thenApply((factorial) -> new FactorialResult(n, factorial));
|
||||
|
||||
pipe(result, getContext().dispatcher()).to(sender());
|
||||
pipe(result, getContext().dispatcher()).to(getSender());
|
||||
|
||||
})
|
||||
.build();
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class FactorialFrontend extends AbstractActor {
|
|||
if (repeat)
|
||||
sendJobs();
|
||||
else
|
||||
getContext().stop(self());
|
||||
getContext().stop(getSelf());
|
||||
}
|
||||
})
|
||||
.match(ReceiveTimeout.class, x -> {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class StatsSampleClient extends AbstractActor {
|
|||
//re-subscribe when restart
|
||||
@Override
|
||||
public void postStop() {
|
||||
cluster.unsubscribe(self());
|
||||
cluster.unsubscribe(getSelf());
|
||||
tickTask.cancel();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,13 +18,13 @@ public class TransformationBackend extends AbstractActor {
|
|||
//subscribe to cluster changes, MemberUp
|
||||
@Override
|
||||
public void preStart() {
|
||||
cluster.subscribe(self(), MemberUp.class);
|
||||
cluster.subscribe(getSelf(), MemberUp.class);
|
||||
}
|
||||
|
||||
//re-subscribe when restart
|
||||
@Override
|
||||
public void postStop() {
|
||||
cluster.unsubscribe(self());
|
||||
cluster.unsubscribe(getSelf());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ public class TransformationFrontend extends AbstractActor {
|
|||
.forward(job, getContext());
|
||||
})
|
||||
.matchEquals(BACKEND_REGISTRATION, x -> {
|
||||
getContext().watch(sender());
|
||||
backends.add(sender());
|
||||
getContext().watch(getSender());
|
||||
backends.add(getSender());
|
||||
})
|
||||
.match(Terminated.class, terminated -> {
|
||||
backends.remove(terminated.getActor());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue