Merge pull request #15492 from gfaerie/master

=doc #15491 java circuit breaker doc update
This commit is contained in:
Konrad Malawski 2014-07-08 13:42:48 +02:00
commit fa6a42d517

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());
} }