如果我有以下 Hystrix 命令:
public class TimeoutDependingOnParam extends HystrixCommand<String> {
private final String name;
public TimeoutDependingOnParam (String name) {
super(HystrixCommandGroupKey.Factory.asKey("ExampleGroup"));
this.name = name;
}
@Override
protected String run() {
if (name.equals("Looong")) {
waitABillionYears();
}
return "Hello " + name + "!";
}
}
调用者:
// no timeout for "Quick"
String s1 = new TimeoutDependingOnParam("Quick").execute();
// timeout for "Looong"
String s2 = new TimeoutDependingOnParam("Looong").execute();
如果Hystrix因为“Looong”的呼叫超时而打开电路,这是否意味着“Quick”的呼叫将被打开?