执行器接口设计
public interface HystrixObservable<R> extends HystrixInvokable<R> {
public Observable<R> observe();
public Observable<R> toObservable();
}
// 执行器
public interface HystrixExecutable<R> extends HystrixInvokable<R> {
public R execute();
public Future<R> queue();
public Observable<R> observe();
}
熔断器配置信息接口
public interface HystrixInvokableInfo<R> {
HystrixCommandGroupKey getCommandGroup();
HystrixCommandKey getCommandKey();
HystrixThreadPoolKey getThreadPoolKey();
String getPublicCacheKey(); //have to use public in the name, as there's already a protected {@link AbstractCommand#getCacheKey()} method.
HystrixCollapserKey getOriginatingCollapserKey();
HystrixCommandMetrics getMetrics();
HystrixCommandProperties getProperties();
boolean isCircuitBreakerOpen();
boolean isExecutionComplete();
boolean isExecutedInThread();
boolean isSuccessfulExecution();
boolean isFailedExecution();
Throwable getFailedExecutionException();
boolean isResponseFromFallback();
boolean isResponseTimedOut();
boolean isResponseShortCircuited();
boolean isResponseFromCache();
boolean isResponseRejected();
boolean isResponseSemaphoreRejected();
boolean isResponseThreadPoolRejected();
List<HystrixEventType> getExecutionEvents();
int getNumberEmissions();
int getNumberFallbackEmissions();
int getNumberCollapsed();
int getExecutionTimeInMilliseconds();
long getCommandRunStartTimeInNanos();
ExecutionResult.EventCounts getEventCounts();
}
抽象基础信息实现