ADD file via upload

main
pf5ub3a78 1 month ago
parent 95d7776d8e
commit 56dbe95076

@ -0,0 +1,38 @@
package com.soa.microservice.core;
/**
*
*
*/
public interface CircuitBreaker {
/**
*
* @return
*/
boolean allowRequest();
/**
*
*/
void recordSuccess();
/**
*
*/
void recordFailure();
/**
*
* @return
*/
State getState();
/**
*
*/
enum State {
CLOSED, // 关闭状态,允许请求通过
OPEN, // 打开状态,拒绝请求
HALF_OPEN // 半开状态,允许有限请求通过以探测服务是否恢复
}
}
Loading…
Cancel
Save