=doc #15491 java circuit breaker doc update

This commit is contained in:
gfaerie 2014-07-03 18:41:58 +02:00
parent 5608abdb9a
commit 3b9ed6ac03

View file

@ -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( pipe(breaker.callWithCircuitBreaker(
new Callable<Future<String>>() {
public Future<String> call() throws Exception {
return future(
new Callable<String>() { new Callable<String>() {
public String call() { public String call() {
return dangerousCall(); return dangerousCall();
} }
}, getContext().dispatcher()); }, getContext().dispatcher());
pipe(breaker.callWithCircuitBreaker(
new Callable<Future<String>>() {
public Future<String> call() throws Exception {
return f;
} }
}), getContext().dispatcher()).to(getSender()); }), getContext().dispatcher()).to(getSender());
} }