Skip to content

Commit

Permalink
chore(release): 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lholmquist committed Jul 26, 2019
1 parent 2be19d7 commit ba14323
Show file tree
Hide file tree
Showing 5 changed files with 224 additions and 318 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [3.0.0](https://github.com/nodeshift/opossum/compare/v2.3.0...v3.0.0) (2019-07-26)


### src

* Remove the Promisify function ([#354](https://github.com/nodeshift/opossum/issues/354)) ([86a6154](https://github.com/nodeshift/opossum/commit/86a6154)), closes [#352](https://github.com/nodeshift/opossum/issues/352)


### BREAKING CHANGES

* Remove the Promisify function from the CircuitBreaker factory

* Node has its own built-in promisify function that can be used instead.



## [2.3.0](https://github.com/nodeshift/opossum/compare/v2.2.0...v2.3.0) (2019-07-01)


Expand Down
94 changes: 6 additions & 88 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.3.0 | Documentation</title>
<title>opossum 3.0.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.3.0</code></div>
<div class='mb1'><code>3.0.0</code></div>
<input
placeholder='Filter'
id='filter-input'
Expand Down Expand Up @@ -45,16 +45,6 @@ <h3 class='mb0 no-anchor'>opossum</h3>
</li>


<li><a
href='#factorypromisify'
class="">
factory.promisify

</a>

</li>


<li><a
href='#factorymetrics'
class="">
Expand Down Expand Up @@ -664,12 +654,13 @@ <h3>Promises vs. Callbacks</h3>
<p>The <code>opossum</code> API returns a <code>Promise</code> from <code>CircuitBreaker.fire()</code>.
But your circuit action - the async function that might fail -
doesn't have to return a promise. You can easily turn Node.js style
callback functions into something <code>opossum</code> understands by using
<code>circuitBreaker.promisify()</code>.</p>
callback functions into something <code>opossum</code> understands by using the built in
Node core utility function <code>util.promisify()</code> .</p>
<pre class='hljs'><span class="hljs-keyword">const</span> fs = <span class="hljs-built_in">require</span>(<span class="hljs-string">'fs'</span>);
<span class="hljs-keyword">const</span> { promisify } = <span class="hljs-built_in">require</span>(<span class="hljs-string">'util'</span>);
<span class="hljs-keyword">const</span> circuitBreaker = <span class="hljs-built_in">require</span>(<span class="hljs-string">'opossum'</span>);

<span class="hljs-keyword">const</span> readFile = circuitBreaker.promisify(fs.readFile);
<span class="hljs-keyword">const</span> readFile = promisify(fs.readFile);
<span class="hljs-keyword">const</span> breaker = circuitBreaker(readFile, options);

breaker.fire(<span class="hljs-string">'./package.json'</span>, <span class="hljs-string">'utf-8'</span>)
Expand Down Expand Up @@ -998,79 +989,6 @@ <h3 class='fl m0' id='factory'>



</section>




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


<div class='clearfix'>

<h3 class='fl m0' id='factorypromisify'>
factory.promisify
</h3>


</div>


<p>Given a function that receives a callback as its last argument,
and which executes that function, passing as parameters <code>err</code> and <code>result</code>,
creates an action that returns a promise which resolves when the function's
callback is executed.</p>

<div class='pre p1 fill-light mt0'>factory.promisify(action: <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function">Function</a>)</div>











<div class='py1 quiet mt1 prose-big'>Parameters</div>
<div class='prose'>

<div class='space-bottom0'>
<div>
<span class='code bold'>action</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function">Function</a>)</code>
A Node.js-like asynchronous function

</div>

</div>

</div>









<div class='py1 quiet mt1 prose-big'>Example</div>


<pre class='p1 overflow-auto round fill-light'><span class="hljs-keyword">const</span> fs = <span class="hljs-built_in">require</span>(<span class="hljs-string">'fs'</span>);
<span class="hljs-keyword">const</span> readFilePromised = circuitBreaker.promisify(fs.readFile);
<span class="hljs-keyword">const</span> breaker = circuitBreaker(readFilePromised);</pre>










</section>


Expand Down
Loading

0 comments on commit ba14323

Please sign in to comment.