src: update opossum to have volumeThreshold

This commit is contained in:
Lance Ball
2018-10-27 13:16:44 -04:00
parent 644c7b5909
commit 993f08f70b
2 changed files with 8 additions and 3 deletions
+5 -2
View File
@@ -1,6 +1,7 @@
// Type definitions for opossum 1.8
// Project: https://github.com/bucharest-gold/opossum
// Type definitions for opossum 1.9
// Project: https://github.com/nodeshift/opossum
// Definitions by: Quinn Langille <https://github.com/quinnlangille>
// Lance Ball <https://github.com/lance>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -31,6 +32,7 @@ export class CircuitBreaker {
static readonly hystrixStats: symbol;
static readonly enabled: symbol;
static readonly warmUp: symbol;
static readonly volumeThreshold: symbol;
}
export interface CircuitBreakerOptions {
@@ -45,6 +47,7 @@ export interface CircuitBreakerOptions {
errorThresholdPercentage?: number;
enabled?: boolean;
allowWarmUp?: boolean;
volumeThreshold?: number;
}
export default function circuitBreaker(
+3 -1
View File
@@ -17,7 +17,8 @@ const options: CircuitBreakerOptions = {
capacity: 1,
errorThresholdPercentage: 1,
enabled: true,
allowWarmUp: true
allowWarmUp: true,
volumeThreshold: 1
};
const testWithOptions: CircuitBreaker = circuitBreaker(_blank, options);
@@ -44,3 +45,4 @@ const shouldBeSymbol7: symbol = CircuitBreaker.hystrixStats;
const shouldBeSymbol8: symbol = CircuitBreaker.status;
const shouldBeSymbol9: symbol = CircuitBreaker.enabled;
const shouldBeSymbol10: symbol = CircuitBreaker.warmUp;
const shouldBeSymbol11: symbol = CircuitBreaker.volumeThreshold;