|
31 | 31 | <input type="text" id="nav-search" placeholder="Search" /> |
32 | 32 |
|
33 | 33 |
|
34 | | - <h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/superbrobenji/async-queue" target="_blank" class="menu-item" id="repository" >Github repo</a></h2><h3>Classes</h3><ul><li><a href="AsyncQueue.module.exports.html">AsyncQueue.module.exports</a></li></ul><h3>Namespaces</h3><ul><li><a href="AsyncQueue.html">AsyncQueue</a><ul class='methods'><li data-type='method' style='display: none;'><a href="AsyncQueue.html#.add">add</a></li><li data-type='method' style='display: none;'><a href="AsyncQueue.html#.setMaxConcurrency">setMaxConcurrency</a></li><li data-type='method' style='display: none;'><a href="AsyncQueue.html#.setMaxRetries">setMaxRetries</a></li><li data-type='method' style='display: none;'><a href="AsyncQueue.html#.setPromiseTimeout">setPromiseTimeout</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#errCallback">errCallback</a></li><li><a href="global.html#promiseFunction">promiseFunction</a></li><li><a href="global.html#resCallback">resCallback</a></li></ul> |
| 34 | + <h2><a href="index.html">Home</a></h2><h2><a href="https://github.com/superbrobenji/async-queue" target="_blank" class="menu-item" id="repository" >Github repo</a></h2><h3>Classes</h3><ul><li><a href="AsyncQueue.module.exports.html">AsyncQueue.module.exports</a></li></ul><h3>Namespaces</h3><ul><li><a href="AsyncQueue.html">AsyncQueue</a><ul class='methods'><li data-type='method' style='display: none;'><a href="AsyncQueue.html#.add">add</a></li><li data-type='method' style='display: none;'><a href="AsyncQueue.html#.setMaxConcurrency">setMaxConcurrency</a></li><li data-type='method' style='display: none;'><a href="AsyncQueue.html#.setMaxRetries">setMaxRetries</a></li><li data-type='method' style='display: none;'><a href="AsyncQueue.html#.setPromiseTimeout">setPromiseTimeout</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#abortHandler">abortHandler</a></li><li><a href="global.html#errCallback">errCallback</a></li><li><a href="global.html#promiseFunction">promiseFunction</a></li><li><a href="global.html#resCallback">resCallback</a></li></ul> |
35 | 35 |
|
36 | 36 | </nav> |
37 | 37 |
|
@@ -80,7 +80,7 @@ <h4 class="name" id="AsyncQueue">AsyncQueue</h4> |
80 | 80 |
|
81 | 81 | <dt class="tag-source">Source:</dt> |
82 | 82 | <dd class="tag-source"><ul class="dummy"><li> |
83 | | - <a href="index.js.html">index.js</a>, <a href="index.js.html#line5">line 5</a> |
| 83 | + <a href="index.js.html">index.js</a>, <a href="index.js.html#line4">line 4</a> |
84 | 84 | </li></ul></dd> |
85 | 85 |
|
86 | 86 |
|
@@ -194,7 +194,7 @@ <h4 class="name" id=".add"><span class="type-signature type-signature-static">(s |
194 | 194 |
|
195 | 195 | <dt class="tag-source">Source:</dt> |
196 | 196 | <dd class="tag-source"><ul class="dummy"><li> |
197 | | - <a href="index.js.html">index.js</a>, <a href="index.js.html#line226">line 226</a> |
| 197 | + <a href="index.js.html">index.js</a>, <a href="index.js.html#line230">line 230</a> |
198 | 198 | </li></ul></dd> |
199 | 199 |
|
200 | 200 |
|
@@ -401,7 +401,7 @@ <h4 class="name" id=".setMaxConcurrency"><span class="type-signature type-signat |
401 | 401 |
|
402 | 402 | <dt class="tag-source">Source:</dt> |
403 | 403 | <dd class="tag-source"><ul class="dummy"><li> |
404 | | - <a href="index.js.html">index.js</a>, <a href="index.js.html#line55">line 55</a> |
| 404 | + <a href="index.js.html">index.js</a>, <a href="index.js.html#line51">line 51</a> |
405 | 405 | </li></ul></dd> |
406 | 406 |
|
407 | 407 |
|
@@ -537,7 +537,7 @@ <h4 class="name" id=".setMaxRetries"><span class="type-signature type-signature- |
537 | 537 |
|
538 | 538 | <dt class="tag-source">Source:</dt> |
539 | 539 | <dd class="tag-source"><ul class="dummy"><li> |
540 | | - <a href="index.js.html">index.js</a>, <a href="index.js.html#line89">line 89</a> |
| 540 | + <a href="index.js.html">index.js</a>, <a href="index.js.html#line85">line 85</a> |
541 | 541 | </li></ul></dd> |
542 | 542 |
|
543 | 543 |
|
@@ -601,7 +601,7 @@ <h5 class="h5-examples">Example</h5> |
601 | 601 |
|
602 | 602 | const errCallback = ( err) => { |
603 | 603 | console.log(err.message) // output: 'max retries reached' |
604 | | - console.log(err.cause) // output: ['rejected', 'rejected', 'rejected'] |
| 604 | + console.log(err.errors) // output: list of errors |
605 | 605 | } |
606 | 606 |
|
607 | 607 | queue.add(pets, callback, errCallback)</code></pre> |
@@ -692,7 +692,8 @@ <h4 class="name" id=".setPromiseTimeout"><span class="type-signature type-signat |
692 | 692 |
|
693 | 693 | <dt class="tag-description">Description:</dt> |
694 | 694 | <dd class="tag-description"><ul class="dummy"><li><p>Set the max amount of time a promise can take to settle |
695 | | -By default the queue will not monitor the promise time to settle</p></li></ul></dd> |
| 695 | +By default the queue will not monitor the promise time to settle |
| 696 | +a signal must be handled in the promise for the timeout to abort the promise</p></li></ul></dd> |
696 | 697 |
|
697 | 698 |
|
698 | 699 |
|
@@ -758,8 +759,11 @@ <h5 class="h5-examples">Example</h5> |
758 | 759 | queue.setPromiseTimeout(100) |
759 | 760 |
|
760 | 761 | //function returns the promise we want to add to queue |
761 | | -const pets = () =>{ |
762 | | - return new Promise((resolve) =>{ |
| 762 | +const pets = (signal) =>{ |
| 763 | + return new Promise((resolve, reject) =>{ |
| 764 | + signal.addEventListener("abort", () => { |
| 765 | + reject("Aborted") |
| 766 | + } |
763 | 767 | setTimeout(resolve, 500) //note that the timeout in the promise is larger than the set promise timeout |
764 | 768 | }) |
765 | 769 | } |
@@ -867,7 +871,7 @@ <h5 class="h5-parameters">Parameters:</h5> |
867 | 871 | <br class="clear"> |
868 | 872 |
|
869 | 873 | <footer> |
870 | | - Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Tue Nov 26 2024 12:40:27 GMT+0200 (South Africa Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. |
| 874 | + Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.4</a> on Tue Nov 26 2024 17:05:18 GMT+0200 (South Africa Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme. |
871 | 875 | </footer> |
872 | 876 |
|
873 | 877 | <script>prettyPrint();</script> |
|
0 commit comments