Skip to content

Commit

Permalink
feat: provide an Iterator of all active circuits (#344)
Browse files Browse the repository at this point in the history
* feat: provide an Iterator of all active circuits

The CircuitBreaker object keeps a Set of instances that have been
created. This change makes a Set Iterator of all circuits that have
not been <code>shutdown()</code>.

Fixes: #340
  • Loading branch information
lance authored Jun 26, 2019
1 parent 2ceeaee commit 13616b0
Show file tree
Hide file tree
Showing 6 changed files with 419 additions and 207 deletions.
153 changes: 150 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset='utf-8' />
<title>opossum 2.1.0 | Documentation</title>
<title>opossum 2.2.0 | Documentation</title>
<meta name='description' content='A fail-fast circuit breaker for promises and callbacks'>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<link href='assets/bass.css' rel='stylesheet' />
Expand All @@ -15,7 +15,7 @@
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
<div class='py1 px2'>
<h3 class='mb0 no-anchor'>opossum</h3>
<div class='mb1'><code>2.1.0</code></div>
<div class='mb1'><code>2.2.0</code></div>
<input
placeholder='Filter'
id='filter-input'
Expand Down Expand Up @@ -65,6 +65,16 @@ <h3 class='mb0 no-anchor'>opossum</h3>
</li>


<li><a
href='#factorycircuits'
class="">
factory.circuits

</a>

</li>


<li><a
href='#circuitbreaker'
class=" toggle-sibling">
Expand All @@ -74,6 +84,17 @@ <h3 class='mb0 no-anchor'>opossum</h3>

<div class='toggle-target display-none'>

<ul class='list-reset py1-ul pl1'>
<li class='h5'><span>Static members</span></li>

<li><a
href='#circuitbreakercircuits'
class='regular pre-open'>
.circuits
</a></li>

</ul>


<ul class='list-reset py1-ul pl1'>
<li class='h5'><span>Instance members</span></li>
Expand Down Expand Up @@ -1089,7 +1110,69 @@ <h3 class='fl m0' id='factorymetrics'>

<div class='py1 quiet mt1 prose-big'>Returns</div>
<code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></code>:
the metrics for all circuits
the metrics for all circuits or
undefined if no circuits have been created
















</section>




<section class='p2 mb2 clearfix bg-white minishadow'>


<div class='clearfix'>

<h3 class='fl m0' id='factorycircuits'>
factory.circuits
</h3>


</div>


<p>Get an <code>Iterator</code> object containing all
circuits that have been created but not subsequently shut down.</p>

<div class='pre p1 fill-light mt0'>factory.circuits(): Iterator</div>
















<div class='py1 quiet mt1 prose-big'>Returns</div>
<code>Iterator</code>:
an
<code>
Iterator
</code>
of all available circuits



Expand Down Expand Up @@ -1358,6 +1441,70 @@ <h3 class='fl m0' id='circuitbreaker'>



<div class='py1 quiet mt1 prose-big'>Static Members</div>
<div class="clearfix">

<div class='border-bottom' id='circuitbreakercircuits'>
<div class="clearfix small pointer toggle-sibling">
<div class="py1 contain">
<a class='icon pin-right py1 dark-link caret-right'></a>
<span class='code strong strong truncate'>circuits()</span>
</div>
</div>
<div class="clearfix display-none toggle-target">
<section class='p2 mb2 clearfix bg-white minishadow'>



<p>Gets a Set iterator of all active circuits. If a circuit
has been created, but subsequently shut down, it will not
be included in the Set iterator.</p>

<div class='pre p1 fill-light mt0'>circuits(): Iterator</div>
















<div class='py1 quiet mt1 prose-big'>Returns</div>
<code>Iterator</code>:
an Iterator object containing a reference
to all {CircuitBreaker} instances that have been created.
















</section>

</div>
</div>

</div>




<div class='py1 quiet mt1 prose-big'>Instance Members</div>
Expand Down
Loading

0 comments on commit 13616b0

Please sign in to comment.