Replaced Action with Directive in SupervisorStrategy. See #1716
This commit is contained in:
parent
4162372024
commit
2a4418799a
6 changed files with 44 additions and 44 deletions
|
|
@ -115,9 +115,9 @@ public class FaultHandlingDocSample {
|
|||
|
||||
// Stop the CounterService child if it throws ServiceUnavailable
|
||||
private static SupervisorStrategy strategy = new OneForOneStrategy(-1, Duration.Inf(),
|
||||
new Function<Throwable, Action>() {
|
||||
new Function<Throwable, Directive>() {
|
||||
@Override
|
||||
public Action apply(Throwable t) {
|
||||
public Directive apply(Throwable t) {
|
||||
if (t instanceof ServiceUnavailable) {
|
||||
return stop();
|
||||
} else {
|
||||
|
|
@ -224,9 +224,9 @@ public class FaultHandlingDocSample {
|
|||
// Restart the storage child when StorageException is thrown.
|
||||
// After 3 restarts within 5 seconds it will be stopped.
|
||||
private static SupervisorStrategy strategy = new OneForOneStrategy(3, Duration.parse("5 seconds"),
|
||||
new Function<Throwable, Action>() {
|
||||
new Function<Throwable, Directive>() {
|
||||
@Override
|
||||
public Action apply(Throwable t) {
|
||||
public Directive apply(Throwable t) {
|
||||
if (t instanceof StorageException) {
|
||||
return restart();
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue