Skip to content

Commit

Permalink
doc: document semaphore-locked and options.capacity
Browse files Browse the repository at this point in the history
  • Loading branch information
lance committed Jun 20, 2017
1 parent 9feb539 commit 5b00bdc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ Here are the events you can listen for.
* `close` - emitted when the breaker state changes to `closed`
* `halfOpen` - emitted when the breaker state changes to `halfOpen`
* `fallback` - emitted when the breaker has a fallback function and executes it
* `semaphore-locked` - emitted when the breaker is at capacity and cannot execute the request

Handling events gives a greater level of control over your application behavior.

Expand Down
3 changes: 3 additions & 0 deletions lib/circuit.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ const CACHE = new WeakMap();
* @param options.rollingPercentilesEnabled {boolean} This property indicates whether execution latencies
* should be tracked and calculated as percentiles.
* If they are disabled, all summary statistics (mean, percentiles) are returned as -1.
* @param options.capacity the number of concurrent requests allowed. If the number of
* currently executing function calls is equal to options.capacity, further calls to `fire()`
* are rejected until at least one of the current requests completes.
*/
class CircuitBreaker extends EventEmitter {
constructor (action, options) {
Expand Down

0 comments on commit 5b00bdc

Please sign in to comment.