Merge pull request #15492 from gfaerie/master
=doc #15491 java circuit breaker doc update
This commit is contained in:
commit
fa6a42d517
1 changed files with 6 additions and 8 deletions
|
|
@ -51,17 +51,15 @@ public class DangerousJavaActor extends UntypedActor {
|
||||||
if (message instanceof String) {
|
if (message instanceof String) {
|
||||||
String m = (String) message;
|
String m = (String) message;
|
||||||
if ("is my middle name".equals(m)) {
|
if ("is my middle name".equals(m)) {
|
||||||
final Future<String> f = future(
|
|
||||||
new Callable<String>() {
|
|
||||||
public String call() {
|
|
||||||
return dangerousCall();
|
|
||||||
}
|
|
||||||
}, getContext().dispatcher());
|
|
||||||
|
|
||||||
pipe(breaker.callWithCircuitBreaker(
|
pipe(breaker.callWithCircuitBreaker(
|
||||||
new Callable<Future<String>>() {
|
new Callable<Future<String>>() {
|
||||||
public Future<String> call() throws Exception {
|
public Future<String> call() throws Exception {
|
||||||
return f;
|
return future(
|
||||||
|
new Callable<String>() {
|
||||||
|
public String call() {
|
||||||
|
return dangerousCall();
|
||||||
|
}
|
||||||
|
}, getContext().dispatcher());
|
||||||
}
|
}
|
||||||
}), getContext().dispatcher()).to(getSender());
|
}), getContext().dispatcher()).to(getSender());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue