1. Added configuration option for 'preferred-nodes' for a clustered actor. The replica set is now tried to be satisfied by the nodes in the list of preferred nodes, if that is not possible, it is randomly selected among the rest.
2. Added test for it. 3. Fixed wrong Java fault-tolerance docs 4. Fixed race condition in maintenance of connections to new nodes Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
This commit is contained in:
parent
e28db64def
commit
f2dd6bddb3
23 changed files with 269 additions and 299 deletions
|
|
@ -117,7 +117,7 @@ The Actor’s supervision can be declaratively defined by creating a ‘Supervis
|
|||
import static akka.config.Supervision.*;
|
||||
import static akka.actor.Actors.*;
|
||||
|
||||
Supervisor supervisor = new Supervisor(
|
||||
Supervisor supervisor = Supervisor.apply(
|
||||
new SupervisorConfig(
|
||||
new AllForOneStrategy(new Class[]{Exception.class}, 3, 5000),
|
||||
new Supervise[] {
|
||||
|
|
@ -141,13 +141,14 @@ MaximumNumberOfRestartsWithinTimeRangeReached message.
|
|||
import static akka.actor.Actors.*;
|
||||
import akka.event.JavaEventHandler;
|
||||
|
||||
Procedure2<ActorRef, MaximumNumberOfRestartsWithinTimeRangeReached> handler = new Procedure2<ActorRef, MaximumNumberOfRestartsWithinTimeRangeReached>() {
|
||||
public void apply(ActorRef ref, MaximumNumberOfRestartsWithinTimeRangeReached max) {
|
||||
JavaEventHandler.error(ref, max);
|
||||
}
|
||||
};
|
||||
Procedure2<ActorRef, MaximumNumberOfRestartsWithinTimeRangeReached> handler =
|
||||
new Procedure2<ActorRef, MaximumNumberOfRestartsWithinTimeRangeReached>() {
|
||||
public void apply(ActorRef ref, MaximumNumberOfRestartsWithinTimeRangeReached max) {
|
||||
JavaEventHandler.error(ref, max);
|
||||
}
|
||||
};
|
||||
|
||||
Supervisor supervisor = new Supervisor(
|
||||
Supervisor supervisor = Supervisor.apply(
|
||||
new SupervisorConfig(
|
||||
new AllForOneStrategy(new Class[]{Exception.class}, 3, 5000),
|
||||
new Supervise[] {
|
||||
|
|
@ -165,7 +166,7 @@ You can link and unlink actors from a declaratively defined supervisor using the
|
|||
|
||||
.. code-block:: java
|
||||
|
||||
Supervisor supervisor = new Supervisor(...);
|
||||
Supervisor supervisor = Supervisor.apply(...);
|
||||
supervisor.link(..);
|
||||
supervisor.unlink(..);
|
||||
|
||||
|
|
@ -209,7 +210,7 @@ Here is an example:
|
|||
import static akka.config.Supervision.*;
|
||||
import static akka.actor.Actors.*;
|
||||
|
||||
Supervisor supervisor = new Supervisor(
|
||||
Supervisor supervisor = Supervisor.apply(
|
||||
new SupervisorConfig(
|
||||
new AllForOneStrategy(new Class[]{Exception.class}, 3, 5000),
|
||||
new Supervise[] {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue