Comparing version 1.9.0 to 1.10.0
162
CHANGELOG.md
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="1.10.0"></a> | ||
# [1.10.0](https://github.com/nodeshift/opossum/compare/v1.9.0...v1.10.0) (2019-01-28) | ||
### Features | ||
* add circuit.shutdown() to shut a circuit down ([e14796c](https://github.com/nodeshift/opossum/commit/e14796c)) | ||
<a name="1.9.0"></a> | ||
@@ -17,3 +27,3 @@ # [1.9.0](https://github.com/nodeshift/opossum/compare/v1.8.0...v1.9.0) (2018-10-27) | ||
<a name="1.8.0"></a> | ||
# [1.8.0](https://github.com/bucharest-gold/opossum/compare/v1.7.1...v1.8.0) (2018-10-02) | ||
# [1.8.0](https://github.com/nodeshift/opossum/compare/v1.7.1...v1.8.0) (2018-10-02) | ||
@@ -23,3 +33,3 @@ | ||
* changed currentTime to number as specified in the docs ([e816f43](https://github.com/bucharest-gold/opossum/commit/e816f43)) | ||
* changed currentTime to number as specified in the docs ([e816f43](https://github.com/nodeshift/opossum/commit/e816f43)) | ||
@@ -29,4 +39,4 @@ | ||
* add options.allowWarmUp as a creation option ([#218](https://github.com/bucharest-gold/opossum/issues/218)) ([ff42d1b](https://github.com/bucharest-gold/opossum/commit/ff42d1b)) | ||
* change default capacity from 10 to MAX_SAFE_INTEGER ([4a8b98b](https://github.com/bucharest-gold/opossum/commit/4a8b98b)) | ||
* add options.allowWarmUp as a creation option ([#218](https://github.com/nodeshift/opossum/issues/218)) ([ff42d1b](https://github.com/nodeshift/opossum/commit/ff42d1b)) | ||
* change default capacity from 10 to MAX_SAFE_INTEGER ([4a8b98b](https://github.com/nodeshift/opossum/commit/4a8b98b)) | ||
@@ -36,3 +46,3 @@ | ||
<a name="1.7.1"></a> | ||
## [1.7.1](https://github.com/bucharest-gold/opossum/compare/v1.7.0...v1.7.1) (2018-07-18) | ||
## [1.7.1](https://github.com/nodeshift/opossum/compare/v1.7.0...v1.7.1) (2018-07-18) | ||
@@ -42,3 +52,3 @@ | ||
<a name="1.7.0"></a> | ||
# [1.7.0](https://github.com/bucharest-gold/opossum/compare/v1.6.0...v1.7.0) (2018-06-06) | ||
# [1.7.0](https://github.com/nodeshift/opossum/compare/v1.6.0...v1.7.0) (2018-06-06) | ||
@@ -48,3 +58,3 @@ | ||
* avoid calling fallback function twice ([#198](https://github.com/bucharest-gold/opossum/issues/198)) ([#201](https://github.com/bucharest-gold/opossum/issues/201)) ([b561a43](https://github.com/bucharest-gold/opossum/commit/b561a43)) | ||
* avoid calling fallback function twice ([#198](https://github.com/nodeshift/opossum/issues/198)) ([#201](https://github.com/nodeshift/opossum/issues/201)) ([b561a43](https://github.com/nodeshift/opossum/commit/b561a43)) | ||
@@ -54,3 +64,3 @@ | ||
* optional timeout ([#200](https://github.com/bucharest-gold/opossum/issues/200)) ([#202](https://github.com/bucharest-gold/opossum/issues/202)) ([7611d6f](https://github.com/bucharest-gold/opossum/commit/7611d6f)) | ||
* optional timeout ([#200](https://github.com/nodeshift/opossum/issues/200)) ([#202](https://github.com/nodeshift/opossum/issues/202)) ([7611d6f](https://github.com/nodeshift/opossum/commit/7611d6f)) | ||
@@ -60,3 +70,3 @@ | ||
<a name="1.6.0"></a> | ||
# [1.6.0](https://github.com/bucharest-gold/opossum/compare/v1.5.0...v1.6.0) (2018-05-24) | ||
# [1.6.0](https://github.com/nodeshift/opossum/compare/v1.5.0...v1.6.0) (2018-05-24) | ||
@@ -66,3 +76,3 @@ | ||
* pass error as parameter to fallback function ([#197](https://github.com/bucharest-gold/opossum/issues/197)) ([ae6c1cc](https://github.com/bucharest-gold/opossum/commit/ae6c1cc)) | ||
* pass error as parameter to fallback function ([#197](https://github.com/nodeshift/opossum/issues/197)) ([ae6c1cc](https://github.com/nodeshift/opossum/commit/ae6c1cc)) | ||
@@ -72,3 +82,3 @@ | ||
<a name="1.5.0"></a> | ||
# [1.5.0](https://github.com/bucharest-gold/opossum/compare/v1.3.1...v1.5.0) (2018-04-25) | ||
# [1.5.0](https://github.com/nodeshift/opossum/compare/v1.3.1...v1.5.0) (2018-04-25) | ||
@@ -78,5 +88,5 @@ | ||
* add full support for webpack and angular ([#185](https://github.com/bucharest-gold/opossum/issues/185)) ([a8cdad6](https://github.com/bucharest-gold/opossum/commit/a8cdad6)) | ||
* address sec vuln in marked coming from jsdoc ([224c6ef](https://github.com/bucharest-gold/opossum/commit/224c6ef)) | ||
* security issue related to electron version ([#138](https://github.com/bucharest-gold/opossum/issues/138)) ([4739c62](https://github.com/bucharest-gold/opossum/commit/4739c62)) | ||
* add full support for webpack and angular ([#185](https://github.com/nodeshift/opossum/issues/185)) ([a8cdad6](https://github.com/nodeshift/opossum/commit/a8cdad6)) | ||
* address sec vuln in marked coming from jsdoc ([224c6ef](https://github.com/nodeshift/opossum/commit/224c6ef)) | ||
* security issue related to electron version ([#138](https://github.com/nodeshift/opossum/issues/138)) ([4739c62](https://github.com/nodeshift/opossum/commit/4739c62)) | ||
@@ -86,4 +96,4 @@ | ||
* add enable/disable for a circuit ([#160](https://github.com/bucharest-gold/opossum/issues/160)) ([016eba5](https://github.com/bucharest-gold/opossum/commit/016eba5)) | ||
* allow multiple circuits to aggregate stats ([#140](https://github.com/bucharest-gold/opossum/issues/140)) ([ba71840](https://github.com/bucharest-gold/opossum/commit/ba71840)) | ||
* add enable/disable for a circuit ([#160](https://github.com/nodeshift/opossum/issues/160)) ([016eba5](https://github.com/nodeshift/opossum/commit/016eba5)) | ||
* allow multiple circuits to aggregate stats ([#140](https://github.com/nodeshift/opossum/issues/140)) ([ba71840](https://github.com/nodeshift/opossum/commit/ba71840)) | ||
@@ -93,3 +103,3 @@ | ||
<a name="1.4.0"></a> | ||
# [1.4.0](https://github.com/bucharest-gold/opossum/compare/v1.3.1...v1.4.0) (2018-03-26) | ||
# [1.4.0](https://github.com/nodeshift/opossum/compare/v1.3.1...v1.4.0) (2018-03-26) | ||
@@ -99,4 +109,4 @@ | ||
* address sec vuln in marked coming from jsdoc ([224c6ef](https://github.com/bucharest-gold/opossum/commit/224c6ef)) | ||
* security issue related to electron version ([#138](https://github.com/bucharest-gold/opossum/issues/138)) ([4739c62](https://github.com/bucharest-gold/opossum/commit/4739c62)) | ||
* address sec vuln in marked coming from jsdoc ([224c6ef](https://github.com/nodeshift/opossum/commit/224c6ef)) | ||
* security issue related to electron version ([#138](https://github.com/nodeshift/opossum/issues/138)) ([4739c62](https://github.com/nodeshift/opossum/commit/4739c62)) | ||
@@ -106,4 +116,4 @@ | ||
* add enable/disable for a circuit ([#160](https://github.com/bucharest-gold/opossum/issues/160)) ([016eba5](https://github.com/bucharest-gold/opossum/commit/016eba5)) | ||
* allow multiple circuits to aggregate stats ([#140](https://github.com/bucharest-gold/opossum/issues/140)) ([ba71840](https://github.com/bucharest-gold/opossum/commit/ba71840)) | ||
* add enable/disable for a circuit ([#160](https://github.com/nodeshift/opossum/issues/160)) ([016eba5](https://github.com/nodeshift/opossum/commit/016eba5)) | ||
* allow multiple circuits to aggregate stats ([#140](https://github.com/nodeshift/opossum/issues/140)) ([ba71840](https://github.com/nodeshift/opossum/commit/ba71840)) | ||
@@ -113,3 +123,3 @@ | ||
<a name="1.3.1"></a> | ||
## [1.3.1](https://github.com/bucharest-gold/opossum/compare/v1.3.0...v1.3.1) (2017-12-14) | ||
## [1.3.1](https://github.com/nodeshift/opossum/compare/v1.3.0...v1.3.1) (2017-12-14) | ||
@@ -119,8 +129,8 @@ | ||
* build on windows10 due browserify limitations ([#112](https://github.com/bucharest-gold/opossum/issues/112)) ([dee4a9a](https://github.com/bucharest-gold/opossum/commit/dee4a9a)) | ||
* halfOpen state does not reject and doesn't trigger a later re-try. ([#120](https://github.com/bucharest-gold/opossum/pull/120) ([04df6f7](https://github.com/bucharest-gold/opossum/commit/04df6f7b9a9b9e9ce672ea1665f1d95586f039a6)) | ||
* build on windows10 due browserify limitations ([#112](https://github.com/nodeshift/opossum/issues/112)) ([dee4a9a](https://github.com/nodeshift/opossum/commit/dee4a9a)) | ||
* halfOpen state does not reject and doesn't trigger a later re-try. ([#120](https://github.com/nodeshift/opossum/pull/120) ([04df6f7](https://github.com/nodeshift/opossum/commit/04df6f7b9a9b9e9ce672ea1665f1d95586f039a6)) | ||
<a name="1.3.0"></a> | ||
# [1.3.0](https://github.com/bucharest-gold/opossum/compare/v1.2.1...v1.3.0) (2017-10-16) | ||
# [1.3.0](https://github.com/nodeshift/opossum/compare/v1.2.1...v1.3.0) (2017-10-16) | ||
@@ -130,5 +140,5 @@ | ||
* ensure breaker.fire() returns rejected promise when fallback fails ([fbedb07](https://github.com/bucharest-gold/opossum/commit/fbedb07)) | ||
* ensure fallback event always fires ([27c3f8b](https://github.com/bucharest-gold/opossum/commit/27c3f8b)) | ||
* JSDoc now available for semaphore-locked event ([6f6c9bd](https://github.com/bucharest-gold/opossum/commit/6f6c9bd)) | ||
* ensure breaker.fire() returns rejected promise when fallback fails ([fbedb07](https://github.com/nodeshift/opossum/commit/fbedb07)) | ||
* ensure fallback event always fires ([27c3f8b](https://github.com/nodeshift/opossum/commit/27c3f8b)) | ||
* JSDoc now available for semaphore-locked event ([6f6c9bd](https://github.com/nodeshift/opossum/commit/6f6c9bd)) | ||
@@ -138,3 +148,3 @@ | ||
* Add health check function to a circuit breaker ([#76](https://github.com/bucharest-gold/opossum/issues/76)) ([0e39faa](https://github.com/bucharest-gold/opossum/commit/0e39faa)) | ||
* Add health check function to a circuit breaker ([#76](https://github.com/nodeshift/opossum/issues/76)) ([0e39faa](https://github.com/nodeshift/opossum/commit/0e39faa)) | ||
@@ -144,3 +154,3 @@ | ||
<a name="1.2.1"></a> | ||
## [1.2.1](https://github.com/bucharest-gold/opossum/compare/v1.2.0...v1.2.1) (2017-06-20) | ||
## [1.2.1](https://github.com/nodeshift/opossum/compare/v1.2.0...v1.2.1) (2017-06-20) | ||
@@ -150,3 +160,3 @@ | ||
<a name="1.2.0"></a> | ||
# [1.2.0](https://github.com/bucharest-gold/opossum/compare/v1.1.0...v1.2.0) (2017-06-20) | ||
# [1.2.0](https://github.com/nodeshift/opossum/compare/v1.1.0...v1.2.0) (2017-06-20) | ||
@@ -156,3 +166,3 @@ | ||
* semaphore added ([#72](https://github.com/bucharest-gold/opossum/issues/72)) ([8c0a46b](https://github.com/bucharest-gold/opossum/commit/8c0a46b)), closes [#60](https://github.com/bucharest-gold/opossum/issues/60) | ||
* semaphore added ([#72](https://github.com/nodeshift/opossum/issues/72)) ([8c0a46b](https://github.com/nodeshift/opossum/commit/8c0a46b)), closes [#60](https://github.com/nodeshift/opossum/issues/60) | ||
@@ -162,3 +172,3 @@ | ||
<a name="1.1.0"></a> | ||
# [1.1.0](https://github.com/bucharest-gold/opossum/compare/v1.0.0...v1.1.0) (2017-06-06) | ||
# [1.1.0](https://github.com/nodeshift/opossum/compare/v1.0.0...v1.1.0) (2017-06-06) | ||
@@ -168,4 +178,4 @@ | ||
* don't let circuits get stuck half open ([5e1171c](https://github.com/bucharest-gold/opossum/commit/5e1171c)) | ||
* fix logic around pendingClose ([4d89ae4](https://github.com/bucharest-gold/opossum/commit/4d89ae4)) | ||
* don't let circuits get stuck half open ([5e1171c](https://github.com/nodeshift/opossum/commit/5e1171c)) | ||
* fix logic around pendingClose ([4d89ae4](https://github.com/nodeshift/opossum/commit/4d89ae4)) | ||
@@ -175,5 +185,5 @@ | ||
* add ETIMEDOUT error code for timeout error ([#64](https://github.com/bucharest-gold/opossum/issues/64)) ([5df9f65](https://github.com/bucharest-gold/opossum/commit/5df9f65)) | ||
* addition of rolling percentile latency's. GH-ISSUE [#38](https://github.com/bucharest-gold/opossum/issues/38) ([ce7b50d](https://github.com/bucharest-gold/opossum/commit/ce7b50d)) | ||
* remove fidelity promises. ([3f5827a](https://github.com/bucharest-gold/opossum/commit/3f5827a)) | ||
* add ETIMEDOUT error code for timeout error ([#64](https://github.com/nodeshift/opossum/issues/64)) ([5df9f65](https://github.com/nodeshift/opossum/commit/5df9f65)) | ||
* addition of rolling percentile latency's. GH-ISSUE [#38](https://github.com/nodeshift/opossum/issues/38) ([ce7b50d](https://github.com/nodeshift/opossum/commit/ce7b50d)) | ||
* remove fidelity promises. ([3f5827a](https://github.com/nodeshift/opossum/commit/3f5827a)) | ||
@@ -183,3 +193,3 @@ | ||
<a name="1.0.0"></a> | ||
# [1.0.0](https://github.com/bucharest-gold/opossum/compare/v0.6.0...v1.0.0) (2017-04-06) | ||
# [1.0.0](https://github.com/nodeshift/opossum/compare/v0.6.0...v1.0.0) (2017-04-06) | ||
@@ -189,5 +199,5 @@ | ||
* do not fire failure event on short circuit ([ab87350](https://github.com/bucharest-gold/opossum/commit/ab87350)) | ||
* make Status an EventEmitter ([8aad11a](https://github.com/bucharest-gold/opossum/commit/8aad11a)) | ||
* remove default maxFailures option ([be65d3b](https://github.com/bucharest-gold/opossum/commit/be65d3b)) | ||
* do not fire failure event on short circuit ([ab87350](https://github.com/nodeshift/opossum/commit/ab87350)) | ||
* make Status an EventEmitter ([8aad11a](https://github.com/nodeshift/opossum/commit/8aad11a)) | ||
* remove default maxFailures option ([be65d3b](https://github.com/nodeshift/opossum/commit/be65d3b)) | ||
@@ -197,7 +207,7 @@ | ||
* add a group option. GH-Issue [#43](https://github.com/bucharest-gold/opossum/issues/43) ([3052f23](https://github.com/bucharest-gold/opossum/commit/3052f23)) | ||
* Add an example on how to use the Hystrix Metrics ([fd8246a](https://github.com/bucharest-gold/opossum/commit/fd8246a)) | ||
* Addition of Hystrix Mertrics Stream. GH-ISSUE [#39](https://github.com/bucharest-gold/opossum/issues/39) ([2d44df6](https://github.com/bucharest-gold/opossum/commit/2d44df6)) | ||
* circuit status now contains a rolling window ([#34](https://github.com/bucharest-gold/opossum/issues/34)) ([05c0a2f](https://github.com/bucharest-gold/opossum/commit/05c0a2f)) | ||
* prefer an error percentage threshold ([245d47b](https://github.com/bucharest-gold/opossum/commit/245d47b)) | ||
* add a group option. GH-Issue [#43](https://github.com/nodeshift/opossum/issues/43) ([3052f23](https://github.com/nodeshift/opossum/commit/3052f23)) | ||
* Add an example on how to use the Hystrix Metrics ([fd8246a](https://github.com/nodeshift/opossum/commit/fd8246a)) | ||
* Addition of Hystrix Mertrics Stream. GH-ISSUE [#39](https://github.com/nodeshift/opossum/issues/39) ([2d44df6](https://github.com/nodeshift/opossum/commit/2d44df6)) | ||
* circuit status now contains a rolling window ([#34](https://github.com/nodeshift/opossum/issues/34)) ([05c0a2f](https://github.com/nodeshift/opossum/commit/05c0a2f)) | ||
* prefer an error percentage threshold ([245d47b](https://github.com/nodeshift/opossum/commit/245d47b)) | ||
@@ -207,3 +217,3 @@ | ||
<a name="0.6.0"></a> | ||
# [0.6.0](https://github.com/bucharest-gold/opossum/compare/v0.5.1...v0.6.0) (2017-03-30) | ||
# [0.6.0](https://github.com/nodeshift/opossum/compare/v0.5.1...v0.6.0) (2017-03-30) | ||
@@ -213,6 +223,6 @@ | ||
* circuit should emit failure event on fallback ([f2594d8](https://github.com/bucharest-gold/opossum/commit/f2594d8)) | ||
* include the error when emitting the 'fallback event' ([40eb2eb](https://github.com/bucharest-gold/opossum/commit/40eb2eb)) | ||
* promise should reject when action throws ([58dab98](https://github.com/bucharest-gold/opossum/commit/58dab98)) | ||
* typo copy past duplicated property ([54a27b9](https://github.com/bucharest-gold/opossum/commit/54a27b9)) | ||
* circuit should emit failure event on fallback ([f2594d8](https://github.com/nodeshift/opossum/commit/f2594d8)) | ||
* include the error when emitting the 'fallback event' ([40eb2eb](https://github.com/nodeshift/opossum/commit/40eb2eb)) | ||
* promise should reject when action throws ([58dab98](https://github.com/nodeshift/opossum/commit/58dab98)) | ||
* typo copy past duplicated property ([54a27b9](https://github.com/nodeshift/opossum/commit/54a27b9)) | ||
@@ -222,8 +232,8 @@ | ||
* add basic rolling stats to a circuit ([8fb9561](https://github.com/bucharest-gold/opossum/commit/8fb9561)) | ||
* Add caching capability to circuits ([6c3144f](https://github.com/bucharest-gold/opossum/commit/6c3144f)) | ||
* Add caching capability to circuits ([0b717f6](https://github.com/bucharest-gold/opossum/commit/0b717f6)) | ||
* Applying code review ([6a0f7ff](https://github.com/bucharest-gold/opossum/commit/6a0f7ff)) | ||
* Applying code review ([8445a24](https://github.com/bucharest-gold/opossum/commit/8445a24)) | ||
* circuits now have a name based on the action ([f08d46e](https://github.com/bucharest-gold/opossum/commit/f08d46e)) | ||
* add basic rolling stats to a circuit ([8fb9561](https://github.com/nodeshift/opossum/commit/8fb9561)) | ||
* Add caching capability to circuits ([6c3144f](https://github.com/nodeshift/opossum/commit/6c3144f)) | ||
* Add caching capability to circuits ([0b717f6](https://github.com/nodeshift/opossum/commit/0b717f6)) | ||
* Applying code review ([6a0f7ff](https://github.com/nodeshift/opossum/commit/6a0f7ff)) | ||
* Applying code review ([8445a24](https://github.com/nodeshift/opossum/commit/8445a24)) | ||
* circuits now have a name based on the action ([f08d46e](https://github.com/nodeshift/opossum/commit/f08d46e)) | ||
@@ -233,3 +243,3 @@ | ||
<a name="0.5.1"></a> | ||
## [0.5.1](https://github.com/bucharest-gold/opossum/compare/v0.5.0...v0.5.1) (2017-03-02) | ||
## [0.5.1](https://github.com/nodeshift/opossum/compare/v0.5.0...v0.5.1) (2017-03-02) | ||
@@ -239,3 +249,3 @@ | ||
<a name="0.5.0"></a> | ||
# [0.5.0](https://github.com/bucharest-gold/opossum/compare/v0.3.0...v0.5.0) (2016-12-22) | ||
# [0.5.0](https://github.com/nodeshift/opossum/compare/v0.3.0...v0.5.0) (2016-12-22) | ||
@@ -245,7 +255,7 @@ | ||
* ensure fallback event emits after function call ([df40ea7](https://github.com/bucharest-gold/opossum/commit/df40ea7)) | ||
* ensure pending close flag is reset ([5a1b70b](https://github.com/bucharest-gold/opossum/commit/5a1b70b)) | ||
* ensure that promise is rejected on fallback ([d4496d8](https://github.com/bucharest-gold/opossum/commit/d4496d8)) | ||
* fix (again) browser load of circuitBreaker ([58a80fb](https://github.com/bucharest-gold/opossum/commit/58a80fb)) | ||
* fix export of module in browser environment ([5a0594c](https://github.com/bucharest-gold/opossum/commit/5a0594c)) | ||
* ensure fallback event emits after function call ([df40ea7](https://github.com/nodeshift/opossum/commit/df40ea7)) | ||
* ensure pending close flag is reset ([5a1b70b](https://github.com/nodeshift/opossum/commit/5a1b70b)) | ||
* ensure that promise is rejected on fallback ([d4496d8](https://github.com/nodeshift/opossum/commit/d4496d8)) | ||
* fix (again) browser load of circuitBreaker ([58a80fb](https://github.com/nodeshift/opossum/commit/58a80fb)) | ||
* fix export of module in browser environment ([5a0594c](https://github.com/nodeshift/opossum/commit/5a0594c)) | ||
@@ -255,4 +265,4 @@ | ||
* allow for a CircuitBreaker as a fallback ([85cbc34](https://github.com/bucharest-gold/opossum/commit/85cbc34)) | ||
* Full featured browser capabilities ([2cc08f0](https://github.com/bucharest-gold/opossum/commit/2cc08f0)) | ||
* allow for a CircuitBreaker as a fallback ([85cbc34](https://github.com/nodeshift/opossum/commit/85cbc34)) | ||
* Full featured browser capabilities ([2cc08f0](https://github.com/nodeshift/opossum/commit/2cc08f0)) | ||
@@ -262,3 +272,3 @@ | ||
<a name="0.4.0"></a> | ||
# [0.4.0](https://github.com/bucharest-gold/opossum/compare/v0.3.0...v0.4.0) (2016-12-20) | ||
# [0.4.0](https://github.com/nodeshift/opossum/compare/v0.3.0...v0.4.0) (2016-12-20) | ||
@@ -268,3 +278,3 @@ | ||
* Full featured browser capabilities ([427c155](https://github.com/bucharest-gold/opossum/commit/427c155)) | ||
* Full featured browser capabilities ([427c155](https://github.com/nodeshift/opossum/commit/427c155)) | ||
@@ -274,3 +284,3 @@ | ||
<a name="0.3.0"></a> | ||
# [0.3.0](https://github.com/bucharest-gold/opossum/compare/v0.2.0...v0.3.0) (2016-12-16) | ||
# [0.3.0](https://github.com/nodeshift/opossum/compare/v0.2.0...v0.3.0) (2016-12-16) | ||
@@ -280,3 +290,3 @@ | ||
* create a browser distribution ([cc8036c](https://github.com/bucharest-gold/opossum/commit/cc8036c)) | ||
* create a browser distribution ([cc8036c](https://github.com/nodeshift/opossum/commit/cc8036c)) | ||
@@ -286,3 +296,3 @@ | ||
<a name="0.2.0"></a> | ||
# [0.2.0](https://github.com/bucharest-gold/opossum/compare/v0.1.1...v0.2.0) (2016-12-13) | ||
# [0.2.0](https://github.com/nodeshift/opossum/compare/v0.1.1...v0.2.0) (2016-12-13) | ||
@@ -292,3 +302,3 @@ | ||
* return 'this' from CircuitBreaker.fallback ([159c006](https://github.com/bucharest-gold/opossum/commit/159c006)) | ||
* return 'this' from CircuitBreaker.fallback ([159c006](https://github.com/nodeshift/opossum/commit/159c006)) | ||
@@ -298,3 +308,3 @@ | ||
<a name="0.1.1"></a> | ||
## [0.1.1](https://github.com/bucharest-gold/opossum/compare/v0.1.0...v0.1.1) (2016-11-03) | ||
## [0.1.1](https://github.com/nodeshift/opossum/compare/v0.1.0...v0.1.1) (2016-11-03) | ||
@@ -304,4 +314,4 @@ | ||
* Don't use Status for managing breaker state ([8c4c659](https://github.com/bucharest-gold/opossum/commit/8c4c659)) | ||
* **events:** Include timeout in stats ([abbdb61](https://github.com/bucharest-gold/opossum/commit/abbdb61)) | ||
* Don't use Status for managing breaker state ([8c4c659](https://github.com/nodeshift/opossum/commit/8c4c659)) | ||
* **events:** Include timeout in stats ([abbdb61](https://github.com/nodeshift/opossum/commit/abbdb61)) | ||
@@ -308,0 +318,0 @@ |
@@ -13,2 +13,3 @@ 'use strict'; | ||
const PENDING_CLOSE = Symbol('pending-close'); | ||
const SHUTDOWN = Symbol('shutdown'); | ||
const FALLBACK_FUNCTION = Symbol('fallback'); | ||
@@ -192,2 +193,21 @@ const STATUS = Symbol('status'); | ||
/** | ||
* Shuts down this circuit breaker. All subsequent calls to the | ||
* circuit will fail, returning a rejected promise. | ||
*/ | ||
shutdown () { | ||
this.disable(); | ||
this.removeAllListeners(); | ||
this.status.shutdown(); | ||
this.hystrixStats.shutdown(); | ||
this[STATE] = SHUTDOWN; | ||
} | ||
/** | ||
* Determines if the circuit has been shutdown. | ||
*/ | ||
get isShutdown () { | ||
return this[STATE] === SHUTDOWN; | ||
} | ||
/** | ||
* Gets the name of this circuit | ||
@@ -244,4 +264,4 @@ */ | ||
/** | ||
A convenience function that returns the hystrixStats | ||
*/ | ||
* A convenience function that returns the hystrixStats. | ||
*/ | ||
get hystrixStats () { | ||
@@ -301,2 +321,7 @@ return this[HYSTRIX_STATS]; | ||
fire () { | ||
if (this.isShutdown) { | ||
const err = new Error('The circuit has been shutdown.'); | ||
err.code = 'ESHUTDOWN'; | ||
return Promise.reject(err); | ||
} | ||
const args = Array.prototype.slice.call(arguments); | ||
@@ -342,6 +367,9 @@ | ||
*/ | ||
this.emit('reject', new Error('Breaker is open')); | ||
const error = new Error('Breaker is open'); | ||
error.code = 'EOPENBREAKER'; | ||
return fallback(this, 'Breaker is open', args) || | ||
Promise.reject(new Error('Breaker is open')); | ||
this.emit('reject', error); | ||
return fallback(this, error, args) || | ||
Promise.reject(error); | ||
} | ||
@@ -533,3 +561,3 @@ this[PENDING_CLOSE] = false; | ||
if (errorRate > circuit.options.errorThresholdPercentage || | ||
circuit.options.maxFailures >= stats.failures || | ||
stats.failures >= circuit.options.maxFailures || | ||
circuit.halfOpen) { | ||
@@ -536,0 +564,0 @@ circuit.open(); |
@@ -14,8 +14,2 @@ 'use strict'; | ||
// TODO: This number is somewhat arbitrary. However, we need to allow | ||
// a potentially large number of listeners on this transform stream | ||
// because all circuits are connected to it. In an application with | ||
// a large number of circuits (or tests using circuits), if left to | ||
// the default MAX_LISTENERS, the user will see errors. | ||
hystrixStream.setMaxListeners(100); | ||
hystrixStream.resume(); | ||
@@ -45,3 +39,3 @@ | ||
constructor (circuit) { | ||
const _readableStream = new Readable({ | ||
this._readableStream = new Readable({ | ||
objectMode: true, | ||
@@ -54,3 +48,3 @@ read () {} | ||
// when we get a snapshot push it onto the stream | ||
_readableStream.push( | ||
this._readableStream.push( | ||
Object.assign({}, | ||
@@ -63,10 +57,10 @@ { | ||
}, stats)); | ||
}); | ||
}.bind(this)); | ||
_readableStream.resume(); | ||
_readableStream.pipe(hystrixStream); | ||
this._readableStream.resume(); | ||
this._readableStream.pipe(hystrixStream); | ||
} | ||
/** | ||
A convenience function that returns the hystrxStream | ||
A convenience function that returns the hystrixStream | ||
*/ | ||
@@ -76,2 +70,11 @@ getHystrixStream () { | ||
} | ||
/** | ||
* Shuts down this instance, freeing memory. | ||
* When a circuit is shutdown, it should call shutdown() on | ||
* its HystrixStats instance to avoid memory leaks. | ||
*/ | ||
shutdown () { | ||
this._readableStream.unpipe(hystrixStream); | ||
} | ||
} | ||
@@ -78,0 +81,0 @@ |
@@ -156,2 +156,6 @@ 'use strict'; | ||
} | ||
shutdown () { | ||
this.removeAllListeners(); | ||
} | ||
} | ||
@@ -158,0 +162,0 @@ |
{ | ||
"name": "opossum", | ||
"version": "1.9.0", | ||
"version": "1.10.0", | ||
"author": "Red Hat, Inc.", | ||
@@ -17,3 +17,3 @@ "license": "Apache-2.0", | ||
"test:coverage": "nyc tape test/*.js | tap-spec", | ||
"prepare": "nsp check && npm run build:browser", | ||
"prepare": "npm audit && npm run build:browser", | ||
"postpublish": "./publish-docs.sh", | ||
@@ -44,13 +44,12 @@ "prerelease": "npm test", | ||
"jsdoc": "3.5.5", | ||
"marked": "~0.5.0", | ||
"moment": "~2.22.0", | ||
"nsp": "~3.2.1", | ||
"nyc": "~12.0.2", | ||
"marked": "~0.6.0", | ||
"moment": "~2.24.0", | ||
"nyc": "~13.1.0", | ||
"opener": "1.5.1", | ||
"semistandard": "~12.0.1", | ||
"semistandard": "~13.0.1", | ||
"standard-version": "4.4.0", | ||
"tap-spec": "~5.0.0", | ||
"tape": "~4.9.0", | ||
"webpack": "~4.23.1", | ||
"webpack-cli": "~3.1.0" | ||
"webpack": "~4.29.0", | ||
"webpack-cli": "~3.2.1" | ||
}, | ||
@@ -57,0 +56,0 @@ "description": "A fail-fast circuit breaker for promises and callbacks", |
@@ -54,2 +54,3 @@ # opossum | ||
``` | ||
### Fallback | ||
@@ -246,1 +247,24 @@ | ||
Additional Reading: [Hystrix Metrics Event Stream](https://github.com/Netflix/Hystrix/tree/master/hystrix-contrib/hystrix-metrics-event-stream), [Turbine](https://github.com/Netflix/Turbine/wiki), [Hystrix Dashboard](https://github.com/Netflix/Hystrix/wiki/Dashboard) | ||
## Troubleshooting | ||
You may run into issues related to too many listeners on an `EventEmitter` like this. | ||
```sh | ||
(node:25619) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 10 unpipe listeners added. Use emitter.setMaxListeners() to increase limit | ||
(node:25619) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added. Use emitter.setMaxListeners() to increase limit | ||
(node:25619) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit | ||
(node:25619) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListeners() to increase limit | ||
(node:25619) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 finish listeners added. Use emitter.setMaxListeners() to increase limit | ||
``` | ||
This typically occurs when you have created more than ten `CircuitBreaker` instances. This is due to the fact that every circuit created is adding a listener to the stream accessed via `circuit.stats.getHystrixStream()`, and the default `EventEmitter` listener limit is 10. In some cases, seeing this error might indicate a bug in client code, where many `CircuitBreaker`s are inadvertently being created. But there are legitimate scenarios where this may not be the case. For example, it could just be that you need more than 10 `CircuitBreaker`s in your app. That's ok. | ||
To get around the error, you can set the number of listeners on the stream. | ||
```js | ||
circuit.stats.getHystrixStream().setMaxListeners(100); | ||
``` | ||
Or it could be that you have a large test suite which exercises some code that creates `CircuitBreaker`s and does so repeatedly. If the `CircuitBreaker` being created is only needed for the duration of the test, use `circuit.shutdown()` when the circuit is no longer in use to clean up all listeners. | ||
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1659545
13
16305
269