本文整理匯總了TypeScript中opossum.CircuitBreaker.clearCache方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript CircuitBreaker.clearCache方法的具體用法?TypeScript CircuitBreaker.clearCache怎麽用?TypeScript CircuitBreaker.clearCache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類opossum.CircuitBreaker
的用法示例。
在下文中一共展示了CircuitBreaker.clearCache方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
const shouldBeVoid5 = (): void => testWithOptions.clearCache();
示例2: asyncFunctionThatCouldFail
breaker.name; // $ExpectType string
breaker.group; // $ExpectType string
breaker.enabled; // $ExpectType boolean
breaker.pendingClose; // $ExpectType boolean
breaker.closed; // $ExpectType boolean
breaker.opened; // $ExpectType boolean
breaker.halfOpen; // $ExpectType boolean
breaker.warmUp; // $ExpectType boolean
breaker.isShutdown; // $ExpectType boolean
breaker.volumeThreshold; // $ExpectType number
breaker.status.stats.latencyMean; // $ExpectType number
breaker.stats.latencyTimes; // $ExpectType number[]
breaker.hystrixStats.getHystrixStream().removeAllListeners();
breaker.clearCache(); // $ExpectType void
breaker.open(); // $ExpectType void
breaker.close(); // $ExpectType void
breaker.disable(); // $ExpectType void
breaker.enable(); // $ExpectType void
breaker.shutdown(); // $ExpectType void
// The following are examples are from the libs README and official documentation
// https://nodeshift.github.io/opossum/index.html.
function asyncFunctionThatCouldFail(x: any, y: any) {
return new Promise((resolve, reject) => {
// Do something, maybe on the network or a disk
resolve([x, y]);
});
}