UNPKG

dynatrace-api-balancer

Version:

A wrapper around Axios that balances and throttles requests across tenants, clusters and cluster nodes.

325 lines (83 loc) 4.37 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: CancellablePromise</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: CancellablePromise</h1> <section> <header> <h2><span class="attribs"><span class="type-signature"></span></span>CancellablePromise<span class="signature">()</span><span class="type-signature"></span></h2> <div class="class-description"><p>A cancellable Promise tat which the request can be cancelled.</p></div> </header> <article> <div class="container-overview"> <h2>Constructor</h2> <h4 class="name" id="CancellablePromise"><span class="type-signature"></span>new CancellablePromise<span class="signature">()</span><span class="type-signature"></span></h4> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_Cancellables.js.html">lib/Cancellables.js</a>, <a href="lib_Cancellables.js.html#line47">line 47</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Extends</h3> <ul> <li>Promise</li> </ul> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="cancel"><span class="type-signature"></span>cancel<span class="signature">(reason)</span><span class="type-signature"></span></h4> <div class="description"> <p>Cancel the request. If a reason is provided, it will cause the <a href="CancellablePromise.html"><code>CancellablePromise</code></a> returned by the <a href="BalancedAPIRequest.html#fetch"><code>fetch()</code></a> method to be called with a <a href="global.html#RequestError"><code>RequestError</code></a> as it single argument, containing status 512 and this reason as its message.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>reason</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><p>The reason for the cancellation. If omitted, the request will be cancelled or aborted silently.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_Cancellables.js.html">lib/Cancellables.js</a>, <a href="lib_Cancellables.js.html#line69">line 69</a> </li></ul></dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BalancedAPIRequest.html">BalancedAPIRequest</a></li><li><a href="CancellableEventEmitter.html">CancellableEventEmitter</a></li><li><a href="CancellablePromise.html">CancellablePromise</a></li><li><a href="DirectAPIRequest.html">DirectAPIRequest</a></li><li><a href="Throttle.html">Throttle</a></li></ul><h3><a href="global.html">Global</a></h3> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.7</a> on Sun Dec 19 2021 10:28:40 GMT-0600 (Central Standard Time) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>