From: Documentation Bot Date: Sun, 16 Nov 2025 16:53:02 +0000 (+0000) Subject: docs: publish documentation X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=79d75fb3bc764f116c274c8adbc65b075f20b592;p=poolifier.git docs: publish documentation --- diff --git a/docs/assets/highlight.css b/docs/assets/highlight.css index ca19fc8e9..4cb403ad0 100644 --- a/docs/assets/highlight.css +++ b/docs/assets/highlight.css @@ -1,6 +1,6 @@ :root { --light-hl-0: #AF00DB; - --dark-hl-0: #C586C0; + --dark-hl-0: #CE92A4; --light-hl-1: #000000; --dark-hl-1: #D4D4D4; --light-hl-2: #001080; diff --git a/docs/assets/main.js b/docs/assets/main.js index 19bbb7a74..64b80ab2d 100644 --- a/docs/assets/main.js +++ b/docs/assets/main.js @@ -1,7 +1,7 @@ "use strict"; window.translations={"copy":"Copy","copied":"Copied!","normally_hidden":"This member is normally hidden due to your filter settings.","hierarchy_expand":"Expand","hierarchy_collapse":"Collapse","folder":"Folder","search_index_not_available":"The search index is not available","search_no_results_found_for_0":"No results found for {0}","kind_1":"Project","kind_2":"Module","kind_4":"Namespace","kind_8":"Enumeration","kind_16":"Enumeration Member","kind_32":"Variable","kind_64":"Function","kind_128":"Class","kind_256":"Interface","kind_512":"Constructor","kind_1024":"Property","kind_2048":"Method","kind_4096":"Call Signature","kind_8192":"Index Signature","kind_16384":"Constructor Signature","kind_32768":"Parameter","kind_65536":"Type Literal","kind_131072":"Type Parameter","kind_262144":"Accessor","kind_524288":"Get Signature","kind_1048576":"Set Signature","kind_2097152":"Type Alias","kind_4194304":"Reference","kind_8388608":"Document"}; -"use strict";(()=>{var Ke=Object.create;var he=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Ze=Object.getOwnPropertyNames;var Xe=Object.getPrototypeOf,Ye=Object.prototype.hasOwnProperty;var et=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var tt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ze(e))!Ye.call(t,i)&&i!==n&&he(t,i,{get:()=>e[i],enumerable:!(r=Ge(e,i))||r.enumerable});return t};var nt=(t,e,n)=>(n=t!=null?Ke(Xe(t)):{},tt(e||!t||!t.__esModule?he(n,"default",{value:t,enumerable:!0}):n,t));var ye=et((me,ge)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,l],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. -`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(oc?d+=2:a==c&&(n+=r[l+1]*i[d+1],l+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var c=s.node.edges["*"];else{var c=new t.TokenSet;s.node.edges["*"]=c}if(s.str.length==0&&(c.final=!0),i.push({node:c,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}s.str.length==1&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),f=s.str.charAt(1),p;f in s.node.edges?p=s.node.edges[f]:(p=new t.TokenSet,s.node.edges[f]=p),s.str.length==1&&(p.final=!0),i.push({node:p,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),c=0;c1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof me=="object"?ge.exports=n():e.lunr=n()}(this,function(){return t})})()});var M,G={getItem(){return null},setItem(){}},K;try{K=localStorage,M=K}catch{K=G,M=G}var S={getItem:t=>M.getItem(t),setItem:(t,e)=>M.setItem(t,e),disableWritingLocalStorage(){M=G},disable(){localStorage.clear(),M=G},enable(){M=K}};window.TypeDoc||={disableWritingLocalStorage(){S.disableWritingLocalStorage()},disableLocalStorage:()=>{S.disable()},enableLocalStorage:()=>{S.enable()}};window.translations||={copy:"Copy",copied:"Copied!",normally_hidden:"This member is normally hidden due to your filter settings.",hierarchy_expand:"Expand",hierarchy_collapse:"Collapse",search_index_not_available:"The search index is not available",search_no_results_found_for_0:"No results found for {0}",folder:"Folder",kind_1:"Project",kind_2:"Module",kind_4:"Namespace",kind_8:"Enumeration",kind_16:"Enumeration Member",kind_32:"Variable",kind_64:"Function",kind_128:"Class",kind_256:"Interface",kind_512:"Constructor",kind_1024:"Property",kind_2048:"Method",kind_4096:"Call Signature",kind_8192:"Index Signature",kind_16384:"Constructor Signature",kind_32768:"Parameter",kind_65536:"Type Literal",kind_131072:"Type Parameter",kind_262144:"Accessor",kind_524288:"Get Signature",kind_1048576:"Set Signature",kind_2097152:"Type Alias",kind_4194304:"Reference",kind_8388608:"Document"};var pe=[];function X(t,e){pe.push({selector:e,constructor:t})}var Z=class{alwaysVisibleMember=null;constructor(){this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}createComponents(e){pe.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!rt(e)){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r,document.querySelector(".col-sidebar").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(!n)return;let r=n.offsetParent==null,i=n;for(;i!==document.body;)i instanceof HTMLDetailsElement&&(i.open=!0),i=i.parentElement;if(n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let s=document.createElement("p");s.classList.add("warning"),s.textContent=window.translations.normally_hidden,n.prepend(s)}r&&e.scrollIntoView()}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent=window.translations.copied,e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent=window.translations.copy},100)},1e3)})})}};function rt(t){let e=t.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(e.bottom<0||e.top-n>=0)}var fe=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var Ie=nt(ye(),1);async function R(t){let e=Uint8Array.from(atob(t),s=>s.charCodeAt(0)),r=new Blob([e]).stream().pipeThrough(new DecompressionStream("deflate")),i=await new Response(r).text();return JSON.parse(i)}var Y="closing",ae="tsd-overlay";function it(){let t=Math.abs(window.innerWidth-document.documentElement.clientWidth);document.body.style.overflow="hidden",document.body.style.paddingRight=`${t}px`}function st(){document.body.style.removeProperty("overflow"),document.body.style.removeProperty("padding-right")}function xe(t,e){t.addEventListener("animationend",()=>{t.classList.contains(Y)&&(t.classList.remove(Y),document.getElementById(ae)?.remove(),t.close(),st())}),t.addEventListener("cancel",n=>{n.preventDefault(),ve(t)}),e?.closeOnClick&&document.addEventListener("click",n=>{t.open&&!t.contains(n.target)&&ve(t)},!0)}function Ee(t){if(t.open)return;let e=document.createElement("div");e.id=ae,document.body.appendChild(e),t.showModal(),it()}function ve(t){if(!t.open)return;document.getElementById(ae)?.classList.add(Y),t.classList.add(Y)}var I=class{el;app;constructor(e){this.el=e.el,this.app=e.app}};var be=document.head.appendChild(document.createElement("style"));be.dataset.for="filters";var le={};function we(t){for(let e of t.split(/\s+/))if(le.hasOwnProperty(e)&&!le[e])return!0;return!1}var ee=class extends I{key;value;constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),be.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +"use strict";(()=>{var Ke=Object.create;var he=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Ze=Object.getOwnPropertyNames;var Xe=Object.getPrototypeOf,Ye=Object.prototype.hasOwnProperty;var et=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var tt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ze(e))!Ye.call(t,i)&&i!==n&&he(t,i,{get:()=>e[i],enumerable:!(r=Ge(e,i))||r.enumerable});return t};var nt=(t,e,n)=>(n=t!=null?Ke(Xe(t)):{},tt(e||!t||!t.__esModule?he(n,"default",{value:t,enumerable:!0}):n,t));var ye=et((me,ge)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=(function(e){return function(n){e.console&&console.warn&&console.warn(n)}})(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,l],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(oc?d+=2:a==c&&(n+=r[l+1]*i[d+1],l+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var c=s.node.edges["*"];else{var c=new t.TokenSet;s.node.edges["*"]=c}if(s.str.length==0&&(c.final=!0),i.push({node:c,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}s.str.length==1&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),f=s.str.charAt(1),p;f in s.node.edges?p=s.node.edges[f]:(p=new t.TokenSet,s.node.edges[f]=p),s.str.length==1&&(p.final=!0),i.push({node:p,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),c=0;c1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},(function(e,n){typeof define=="function"&&define.amd?define(n):typeof me=="object"?ge.exports=n():e.lunr=n()})(this,function(){return t})})()});var M,G={getItem(){return null},setItem(){}},K;try{K=localStorage,M=K}catch{K=G,M=G}var S={getItem:t=>M.getItem(t),setItem:(t,e)=>M.setItem(t,e),disableWritingLocalStorage(){M=G},disable(){localStorage.clear(),M=G},enable(){M=K}};window.TypeDoc||={disableWritingLocalStorage(){S.disableWritingLocalStorage()},disableLocalStorage:()=>{S.disable()},enableLocalStorage:()=>{S.enable()}};window.translations||={copy:"Copy",copied:"Copied!",normally_hidden:"This member is normally hidden due to your filter settings.",hierarchy_expand:"Expand",hierarchy_collapse:"Collapse",search_index_not_available:"The search index is not available",search_no_results_found_for_0:"No results found for {0}",folder:"Folder",kind_1:"Project",kind_2:"Module",kind_4:"Namespace",kind_8:"Enumeration",kind_16:"Enumeration Member",kind_32:"Variable",kind_64:"Function",kind_128:"Class",kind_256:"Interface",kind_512:"Constructor",kind_1024:"Property",kind_2048:"Method",kind_4096:"Call Signature",kind_8192:"Index Signature",kind_16384:"Constructor Signature",kind_32768:"Parameter",kind_65536:"Type Literal",kind_131072:"Type Parameter",kind_262144:"Accessor",kind_524288:"Get Signature",kind_1048576:"Set Signature",kind_2097152:"Type Alias",kind_4194304:"Reference",kind_8388608:"Document"};var pe=[];function X(t,e){pe.push({selector:e,constructor:t})}var Z=class{alwaysVisibleMember=null;constructor(){this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}createComponents(e){pe.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!rt(e)){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r,document.querySelector(".col-sidebar").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(!n)return;let r=n.offsetParent==null,i=n;for(;i!==document.body;)i instanceof HTMLDetailsElement&&(i.open=!0),i=i.parentElement;if(n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let s=document.createElement("p");s.classList.add("warning"),s.textContent=window.translations.normally_hidden,n.prepend(s)}r&&e.scrollIntoView()}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent=window.translations.copied,e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent=window.translations.copy},100)},1e3)})})}};function rt(t){let e=t.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(e.bottom<0||e.top-n>=0)}var fe=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var Ie=nt(ye(),1);async function R(t){let e=Uint8Array.from(atob(t),s=>s.charCodeAt(0)),r=new Blob([e]).stream().pipeThrough(new DecompressionStream("deflate")),i=await new Response(r).text();return JSON.parse(i)}var Y="closing",ae="tsd-overlay";function it(){let t=Math.abs(window.innerWidth-document.documentElement.clientWidth);document.body.style.overflow="hidden",document.body.style.paddingRight=`${t}px`}function st(){document.body.style.removeProperty("overflow"),document.body.style.removeProperty("padding-right")}function xe(t,e){t.addEventListener("animationend",()=>{t.classList.contains(Y)&&(t.classList.remove(Y),document.getElementById(ae)?.remove(),t.close(),st())}),t.addEventListener("cancel",n=>{n.preventDefault(),ve(t)}),e?.closeOnClick&&document.addEventListener("click",n=>{t.open&&!t.contains(n.target)&&ve(t)},!0)}function Ee(t){if(t.open)return;let e=document.createElement("div");e.id=ae,document.body.appendChild(e),t.showModal(),it()}function ve(t){if(!t.open)return;document.getElementById(ae)?.classList.add(Y),t.classList.add(Y)}var I=class{el;app;constructor(e){this.el=e.el,this.app=e.app}};var be=document.head.appendChild(document.createElement("style"));be.dataset.for="filters";var le={};function we(t){for(let e of t.split(/\s+/))if(le.hasOwnProperty(e)&&!le[e])return!0;return!1}var ee=class extends I{key;value;constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),be.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } `,this.app.updateIndexVisibility()}fromLocalStorage(){let e=S.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){S.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),le[`tsd-is-${this.el.name}`]=this.value,this.app.filterChanged(),this.app.updateIndexVisibility()}};var Le=0;async function Se(t,e){if(!window.searchData)return;let n=await R(window.searchData);t.data=n,t.index=Ie.Index.load(n.index),e.innerHTML=""}function _e(){let t=document.getElementById("tsd-search-trigger"),e=document.getElementById("tsd-search"),n=document.getElementById("tsd-search-input"),r=document.getElementById("tsd-search-results"),i=document.getElementById("tsd-search-script"),s=document.getElementById("tsd-search-status");if(!(t&&e&&n&&r&&i&&s))throw new Error("Search controls missing");let o={base:document.documentElement.dataset.base};o.base.endsWith("/")||(o.base+="/"),i.addEventListener("error",()=>{let a=window.translations.search_index_not_available;Pe(s,a)}),i.addEventListener("load",()=>{Se(o,s)}),Se(o,s),ot({trigger:t,searchEl:e,results:r,field:n,status:s},o)}function ot(t,e){let{field:n,results:r,searchEl:i,status:s,trigger:o}=t;xe(i,{closeOnClick:!0});function a(){Ee(i),n.setSelectionRange(0,n.value.length)}o.addEventListener("click",a),n.addEventListener("input",fe(()=>{at(r,n,s,e)},200)),n.addEventListener("keydown",l=>{if(r.childElementCount===0||l.ctrlKey||l.metaKey||l.altKey)return;let d=n.getAttribute("aria-activedescendant"),f=d?document.getElementById(d):null;if(f){let p=!1,v=!1;switch(l.key){case"Home":case"End":case"ArrowLeft":case"ArrowRight":v=!0;break;case"ArrowDown":case"ArrowUp":p=l.shiftKey;break}(p||v)&&ke(n)}if(!l.shiftKey)switch(l.key){case"Enter":f?.querySelector("a")?.click();break;case"ArrowUp":Te(r,n,f,-1),l.preventDefault();break;case"ArrowDown":Te(r,n,f,1),l.preventDefault();break}});function c(){ke(n)}n.addEventListener("change",c),n.addEventListener("blur",c),n.addEventListener("click",c),document.body.addEventListener("keydown",l=>{if(l.altKey||l.metaKey||l.shiftKey)return;let d=l.ctrlKey&&l.key==="k",f=!l.ctrlKey&&!ut()&&l.key==="/";(d||f)&&(l.preventDefault(),a())})}function at(t,e,n,r){if(!r.index||!r.data)return;t.innerHTML="",n.innerHTML="",Le+=1;let i=e.value.trim(),s;if(i){let a=i.split(" ").map(c=>c.length?`*${c}*`:"").join(" ");s=r.index.search(a).filter(({ref:c})=>{let l=r.data.rows[Number(c)].classes;return!l||!we(l)})}else s=[];if(s.length===0&&i){let a=window.translations.search_no_results_found_for_0.replace("{0}",` "${te(i)}" `);Pe(n,a);return}for(let a=0;ac.score-a.score);let o=Math.min(10,s.length);for(let a=0;a`,f=Ce(c.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(f+=` (score: ${s[a].score.toFixed(2)})`),c.parent&&(f=` ${Ce(c.parent,i)}.${f}`);let p=document.createElement("li");p.id=`tsd-search:${Le}-${a}`,p.role="option",p.ariaSelected="false",p.classList.value=c.classes??"";let v=document.createElement("a");v.tabIndex=-1,v.href=r.base+c.url,v.innerHTML=d+`${f}`,p.append(v),t.appendChild(p)}}function Te(t,e,n,r){let i;if(r===1?i=n?.nextElementSibling||t.firstElementChild:i=n?.previousElementSibling||t.lastElementChild,i!==n){if(!i||i.role!=="option"){console.error("Option missing");return}i.ariaSelected="true",i.scrollIntoView({behavior:"smooth",block:"nearest"}),e.setAttribute("aria-activedescendant",i.id),n?.setAttribute("aria-selected","false")}}function ke(t){let e=t.getAttribute("aria-activedescendant");(e?document.getElementById(e):null)?.setAttribute("aria-selected","false"),t.setAttribute("aria-activedescendant","")}function Ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(te(t.substring(s,o)),`${te(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(te(t.substring(s))),i.join("")}var lt={"&":"&","<":"<",">":">","'":"'",'"':"""};function te(t){return t.replace(/[&<>"'"]/g,e=>lt[e])}function Pe(t,e){t.innerHTML=e?`
${e}
`:""}var ct=["button","checkbox","file","hidden","image","radio","range","reset","submit"];function ut(){let t=document.activeElement;return t?t.isContentEditable||t.tagName==="TEXTAREA"||t.tagName==="SEARCH"?!0:t.tagName==="INPUT"&&!ct.includes(t.type):!1}var D="mousedown",Me="mousemove",$="mouseup",ne={x:0,y:0},Qe=!1,ce=!1,dt=!1,F=!1,Oe=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(Oe?"is-mobile":"not-mobile");Oe&&"ontouchstart"in document.documentElement&&(dt=!0,D="touchstart",Me="touchmove",$="touchend");document.addEventListener(D,t=>{ce=!0,F=!1;let e=D=="touchstart"?t.targetTouches[0]:t;ne.y=e.pageY||0,ne.x=e.pageX||0});document.addEventListener(Me,t=>{if(ce&&!F){let e=D=="touchstart"?t.targetTouches[0]:t,n=ne.x-(e.pageX||0),r=ne.y-(e.pageY||0);F=Math.sqrt(n*n+r*r)>10}});document.addEventListener($,()=>{ce=!1});document.addEventListener("click",t=>{Qe&&(t.preventDefault(),t.stopImmediatePropagation(),Qe=!1)});var re=class extends I{active;className;constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener($,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(D,n=>this.onDocumentPointerDown(n)),document.addEventListener($,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){F||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!F&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var ue=new Map,de=class{open;accordions=[];key;constructor(e,n){this.key=e,this.open=n}add(e){this.accordions.push(e),e.open=this.open,e.addEventListener("toggle",()=>{this.toggle(e.open)})}toggle(e){for(let n of this.accordions)n.open=e;S.setItem(this.key,e.toString())}},ie=class extends I{constructor(e){super(e);let n=this.el.querySelector("summary"),r=n.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)});let i=`tsd-accordion-${n.dataset.key??n.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`,s;if(ue.has(i))s=ue.get(i);else{let o=S.getItem(i),a=o?o==="true":this.el.open;s=new de(i,a),ue.set(i,s)}s.add(this.el)}};function He(t){let e=S.getItem("tsd-theme")||"os";t.value=e,Ae(e),t.addEventListener("change",()=>{S.setItem("tsd-theme",t.value),Ae(t.value)})}function Ae(t){document.documentElement.dataset.theme=t}var se;function Ne(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",Re),Re())}async function Re(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let e=await R(window.navigationData);se=document.documentElement.dataset.base,se.endsWith("/")||(se+="/"),t.innerHTML="";for(let n of e)Be(n,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function Be(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-accordion`:"tsd-accordion";let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.dataset.key=i.join("$"),o.innerHTML='',De(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let c=a.appendChild(document.createElement("ul"));c.className="tsd-nested-navigation";for(let l of t.children)Be(l,c,i)}else De(t,r,t.class)}function De(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));if(r.href=se+t.path,n&&(r.className=n),location.pathname===r.pathname&&!r.href.includes("#")&&(r.classList.add("current"),r.ariaCurrent="page"),t.kind){let i=window.translations[`kind_${t.kind}`].replaceAll('"',""");r.innerHTML=``}r.appendChild(Fe(t.text,document.createElement("span")))}else{let r=e.appendChild(document.createElement("span")),i=window.translations.folder.replaceAll('"',""");r.innerHTML=``,r.appendChild(Fe(t.text,document.createElement("span")))}}function Fe(t,e){let n=t.split(/(?<=[^A-Z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])|(?<=[_-])(?=[^_-])/);for(let r=0;r{let i=r.target;for(;i.parentElement&&i.parentElement.tagName!="LI";)i=i.parentElement;i.dataset.dropdown&&(i.dataset.dropdown=String(i.dataset.dropdown!=="true"))});let t=new Map,e=new Set;for(let r of document.querySelectorAll(".tsd-full-hierarchy [data-refl]")){let i=r.querySelector("ul");t.has(r.dataset.refl)?e.add(r.dataset.refl):i&&t.set(r.dataset.refl,i)}for(let r of e)n(r);function n(r){let i=t.get(r).cloneNode(!0);i.querySelectorAll("[id]").forEach(s=>{s.removeAttribute("id")}),i.querySelectorAll("[data-dropdown]").forEach(s=>{s.dataset.dropdown="false"});for(let s of document.querySelectorAll(`[data-refl="${r}"]`)){let o=gt(),a=s.querySelector("ul");s.insertBefore(o,a),o.dataset.dropdown=String(!!a),a||s.appendChild(i.cloneNode(!0))}}}function pt(){let t=document.getElementById("tsd-hierarchy-script");t&&(t.addEventListener("load",Ve),Ve())}async function Ve(){let t=document.querySelector(".tsd-panel.tsd-hierarchy:has(h4 a)");if(!t||!window.hierarchyData)return;let e=+t.dataset.refl,n=await R(window.hierarchyData),r=t.querySelector("ul"),i=document.createElement("ul");if(i.classList.add("tsd-hierarchy"),ft(i,n,e),r.querySelectorAll("li").length==i.querySelectorAll("li").length)return;let s=document.createElement("span");s.classList.add("tsd-hierarchy-toggle"),s.textContent=window.translations.hierarchy_expand,t.querySelector("h4 a")?.insertAdjacentElement("afterend",s),s.insertAdjacentText("beforebegin",", "),s.addEventListener("click",()=>{s.textContent===window.translations.hierarchy_expand?(r.insertAdjacentElement("afterend",i),r.remove(),s.textContent=window.translations.hierarchy_collapse):(i.insertAdjacentElement("afterend",r),i.remove(),s.textContent=window.translations.hierarchy_expand)})}function ft(t,e,n){let r=e.roots.filter(i=>mt(e,i,n));for(let i of r)t.appendChild(je(e,i,n))}function je(t,e,n,r=new Set){if(r.has(e))return;r.add(e);let i=t.reflections[e],s=document.createElement("li");if(s.classList.add("tsd-hierarchy-item"),e===n){let o=s.appendChild(document.createElement("span"));o.textContent=i.name,o.classList.add("tsd-hierarchy-target")}else{for(let a of i.uniqueNameParents||[]){let c=t.reflections[a],l=s.appendChild(document.createElement("a"));l.textContent=c.name,l.href=oe+c.url,l.className=c.class+" tsd-signature-type",s.append(document.createTextNode("."))}let o=s.appendChild(document.createElement("a"));o.textContent=t.reflections[e].name,o.href=oe+i.url,o.className=i.class+" tsd-signature-type"}if(i.children){let o=s.appendChild(document.createElement("ul"));o.classList.add("tsd-hierarchy");for(let a of i.children){let c=je(t,a,n,r);c&&o.appendChild(c)}}return r.delete(e),s}function mt(t,e,n){if(e===n)return!0;let r=new Set,i=[t.reflections[e]];for(;i.length;){let s=i.pop();if(!r.has(s)){r.add(s);for(let o of s.children||[]){if(o===n)return!0;i.push(t.reflections[o])}}}return!1}function gt(){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("width","20"),t.setAttribute("height","20"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.innerHTML='',t}X(re,"a[data-toggle]");X(ie,".tsd-accordion");X(ee,".tsd-filter-item input[type=checkbox]");var qe=document.getElementById("tsd-theme");qe&&He(qe);var yt=new Z;Object.defineProperty(window,"app",{value:yt});_e();Ne();$e();"virtualKeyboard"in navigator&&(navigator.virtualKeyboard.overlaysContent=!0);})(); /*! Bundled license information: diff --git a/docs/classes/src.ClusterWorker.html b/docs/classes/src.ClusterWorker.html index 10ab7a449..9d2db5247 100644 --- a/docs/classes/src.ClusterWorker.html +++ b/docs/classes/src.ClusterWorker.html @@ -1,4 +1,4 @@ -ClusterWorker | poolifier - v5.1.6
poolifier - v5.1.6
    Preparing search index...

    Class ClusterWorker<Data, Response>

    A cluster worker used by a poolifier ClusterPool.

    +ClusterWorker | poolifier - v5.1.7
    poolifier - v5.1.7
      Preparing search index...

      Class ClusterWorker<Data, Response>

      A cluster worker used by a poolifier ClusterPool.

      When this worker is inactive for more than the given maxInactiveTime, it will send a termination request to its main worker.

      If you use a DynamicClusterPool the extra workers that were created will be terminated, @@ -6,8 +6,8 @@ but the minimum number of workers will be guaranteed.

      2.0.0

      Type Parameters

      • Data = unknown

        Type of data this worker receives from pool's execution. This can only be structured-cloneable data.

        -
      • Response = unknown

        Type of response the worker sends back to the main worker. This can only be structured-cloneable data.

        -

      Hierarchy (View Summary)

      Index

      Constructors

    • Response = unknown

      Type of response the worker sends back to the main worker. This can only be structured-cloneable data.

      +
    • Hierarchy (View Summary)

      Index

      Constructors

      Properties

      activeInterval? isMain lastTaskTimestamp @@ -34,52 +34,52 @@ but the minimum number of workers will be guaranteed.

      setDefaultTaskFunction

      Constructors

      Properties

      activeInterval?: Timeout

      Handler id of the activeInterval worker activity check.

      -
      isMain: undefined | boolean

      Whether this is the main worker or not.

      -
      lastTaskTimestamp: number

      Timestamp of the last task processed by this worker.

      -
      opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

      Options for the worker.

      -
      statistics?: WorkerStatistics

      Performance statistics computation requirements.

      -
      taskAbortFunctions: Map<
          `${string}-${string}-${string}-${string}-${string}`,
          () => void,
      >

      Task abort functions processed by the worker when task operation 'abort' is received.

      -
      taskFunctions: Map<string, TaskFunctionObject<Data, Response>>

      Task function object(s) processed by the worker when the pool's execute method is invoked.

      -

      Accessors

      Methods

      Returns ClusterWorker<Data, Response>

      Properties

      activeInterval?: Timeout

      Handler id of the activeInterval worker activity check.

      +
      isMain: boolean | undefined

      Whether this is the main worker or not.

      +
      lastTaskTimestamp: number

      Timestamp of the last task processed by this worker.

      +
      opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

      Options for the worker.

      +
      statistics?: WorkerStatistics

      Performance statistics computation requirements.

      +
      taskAbortFunctions: Map<
          `${string}-${string}-${string}-${string}-${string}`,
          () => void,
      >

      Task abort functions processed by the worker when task operation 'abort' is received.

      +
      taskFunctions: Map<string, TaskFunctionObject<Data, Response>>

      Task function object(s) processed by the worker when the pool's execute method is invoked.

      +

      Accessors

      Methods

      Returns TaskFunctionOperationResult

      Whether the task function was added or not.

      +
      • Handles a worker error.

        Parameters

        • error: Error

          The error raised by the worker.

          -

        Returns { aborted: boolean; message: string; stack?: string }

        The worker error object.

        -
      • Handles a kill message sent by the main worker.

        +

      Returns { aborted: boolean; message: string; stack?: string }

      The worker error object.

      +
      • Handles the ready message sent by the main worker.

        +

      Returns void

      Returns void

      Returns TaskFunctionOperationResult

      Whether the worker has a task function with the given name or not.

      +

      Returns void

      • Runs the given task.

        +

      Returns TaskFunctionOperationResult

      Whether the task function existed and was removed or not.

      +

      Returns void

      Returns void

      Returns void

      Returns void

      +

      Returns TaskFunctionOperationResult

      Whether the default task function was set or not.

      +
      diff --git a/docs/classes/src.DynamicClusterPool.html b/docs/classes/src.DynamicClusterPool.html index 4059f5fea..6807c41d9 100644 --- a/docs/classes/src.DynamicClusterPool.html +++ b/docs/classes/src.DynamicClusterPool.html @@ -1,11 +1,11 @@ -DynamicClusterPool | poolifier - v5.1.6
      poolifier - v5.1.6
        Preparing search index...

        Class DynamicClusterPool<Data, Response>

        A cluster pool with a dynamic number of workers, but a guaranteed minimum number of workers.

        +DynamicClusterPool | poolifier - v5.1.7
        poolifier - v5.1.7
          Preparing search index...

          Class DynamicClusterPool<Data, Response>

          A cluster pool with a dynamic number of workers, but a guaranteed minimum number of workers.

          This cluster pool creates new workers when the others are busy, up to the maximum number of workers. When the maximum number of workers is reached and workers are busy, an event is emitted. If you want to listen to this event, use the pool's emitter.

          2.0.0

          Type Parameters

          • Data = unknown

            Type of data sent to the worker. This can only be structured-cloneable data.

            -
          • Response = unknown

            Type of execution response. This can only be structured-cloneable data.

            -

          Hierarchy (View Summary)

          Index

          Constructors

        • Response = unknown

          Type of execution response. This can only be structured-cloneable data.

          +
        • Hierarchy (View Summary)

          Index

          Constructors

          Properties

          destroying emitter? filePath @@ -59,76 +59,76 @@ When the maximum number of workers is reached and workers are busy, an event is workerMessageListener

          Constructors

          Properties

          destroying: boolean

          Whether the pool is destroying or not.

          -
          emitter?: EventEmitterAsyncResource
          filePath: string

          Path to the worker file.

          -
          maximumNumberOfWorkers?: number

          Maximum number of workers that this pool manages.

          -
          minimumNumberOfWorkers: number

          Minimum number of workers that this pool manages.

          -
          opts: PoolOptions<Worker>

          Options for the pool.

          -
          promiseResponseMap: Map<
              `${string}-${string}-${string}-${string}-${string}`,
              PromiseResponseWrapper<Response>,
          > = ...

          The task execution response promise map:

          +
        • max: number

          Maximum number of workers that can be created by this pool.

          +
        • filePath: string

          Path to an implementation of a ClusterWorker file, which can be relative or absolute.

          +
        • opts: ClusterPoolOptions = {}

          Options for this dynamic cluster pool.

          +
        • Returns DynamicClusterPool<Data, Response>

          Properties

          destroying: boolean

          Whether the pool is destroying or not.

          +
          emitter?: EventEmitterAsyncResource
          filePath: string

          Path to the worker file.

          +
          maximumNumberOfWorkers?: number

          Maximum number of workers that this pool manages.

          +
          minimumNumberOfWorkers: number

          Minimum number of workers that this pool manages.

          +
          opts: PoolOptions<Worker>

          Options for the pool.

          +
          promiseResponseMap: Map<
              `${string}-${string}-${string}-${string}-${string}`,
              PromiseResponseWrapper<Response>,
          > = ...

          The task execution response promise map:

          • key: The message id of each submitted task.
          • value: An object that contains task's worker node key, execution response promise resolve and reject callbacks, async resource.

          When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id.

          -
          started: boolean

          Whether the pool is started or not.

          -
          starting: boolean

          Whether the pool is starting or not.

          -
          workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<
              Worker,
              Data,
              Response,
          >

          Worker choice strategies context referencing worker choice algorithms implementation.

          -
          workerNodes: IWorkerNode<Worker, Data>[] = []

          Accessors

          started: boolean

          Whether the pool is started or not.

          +
          starting: boolean

          Whether the pool is starting or not.

          +
          workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<
              Worker,
              Data,
              Response,
          >

          Worker choice strategies context referencing worker choice algorithms implementation.

          +
          workerNodes: IWorkerNode<Worker, Data>[] = []

          Accessors

          • get backPressure(): boolean

            Whether the pool is back pressured or not.

            Returns boolean

            The pool back pressure boolean status.

            -
          • get busy(): boolean

            Whether the pool is busy or not.

            Returns boolean

            The pool busyness boolean status.

            -
          • get type(): "fixed" | "dynamic"

            The pool type.

            If it is 'dynamic', it provides the max property.

            -

            Returns "fixed" | "dynamic"

          • get worker(): "cluster" | "thread"

            The worker type.

            -

            Returns "cluster" | "thread"

          Methods

          • Hook executed after the worker task execution. +

            Returns "fixed" | "dynamic"

          • get worker(): "cluster" | "thread"

            The worker type.

            +

            Returns "cluster" | "thread"

          Methods

          • Method hooked up after a worker node has been newly created. +

          • message: MessageValue<Response>

            The received message.

            +

          Returns void

          • Hook executed before the worker task execution. +

          Returns void

          • Creates a new, completely set up dynamic worker node.

            +
          • task: Task<Data>

            The task to execute.

            +

          Returns void

          • Terminates the worker node given its worker node key.

            +
          • listener: (message: MessageValue<Message>) => void

            The message listener callback.

            +

          Returns void

          • Parameters

            • Optionaldata: Data
            • Optionalname: string
            • OptionalabortSignal: AbortSignal
            • OptionaltransferList: readonly Transferable[]

            Returns Promise<Response>

          • Gets the worker information given its worker node key.

            +

          Returns Promise<void>

          • Parameters

            • Optionaldata: Data
            • Optionalname: string
            • OptionalabortSignal: AbortSignal
            • OptionaltransferList: readonly Transferable[]

            Returns Promise<Response>

          • Whether the worker nodes are back pressured or not.

            +

          Returns WorkerInfo | undefined

          The worker information.

          +
          • Parameters

            • data: Iterable<Data>
            • Optionalname: string
            • OptionalabortSignals: Iterable<AbortSignal, any, any>
            • OptionaltransferList: readonly Transferable[]

            Returns Promise<Response[]>

          • Parameters

            • data: Iterable<Data>
            • Optionalname: string
            • OptionalabortSignals: Iterable<AbortSignal, any, any>
            • OptionaltransferList: readonly Transferable[]

            Returns Promise<Response[]>

          • Registers a listener callback on the worker given its worker node key.

            +
          • listener: (message: MessageValue<Message>) => void

            The message listener callback.

            +

          Returns void

          • Sends the startup message to worker given its worker node key.

            +
          • listener: (message: MessageValue<Message>) => void

            The message listener callback.

            +

          Returns void

          • Sends a message to worker given its worker node key.

            +

          Returns void

          • Setup hook to execute code before worker nodes are created in the abstract constructor. +

          • message: MessageValue<Data>

            The message.

            +

          Returns void

          • Parameters

            • workerChoiceStrategy:
                  | "FAIR_SHARE"
                  | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                  | "LEAST_BUSY"
                  | "LEAST_ELU"
                  | "LEAST_USED"
                  | "ROUND_ROBIN"
                  | "WEIGHTED_ROUND_ROBIN"
            • OptionalworkerChoiceStrategyOptions: WorkerChoiceStrategyOptions

            Returns void

          • Parameters

            • workerChoiceStrategy:
                  | "FAIR_SHARE"
                  | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                  | "LEAST_BUSY"
                  | "LEAST_ELU"
                  | "LEAST_USED"
                  | "ROUND_ROBIN"
                  | "WEIGHTED_ROUND_ROBIN"
            • OptionalworkerChoiceStrategyOptions: WorkerChoiceStrategyOptions

            Returns void

          +

          Returns void

          diff --git a/docs/classes/src.DynamicThreadPool.html b/docs/classes/src.DynamicThreadPool.html index 6ee9d95a1..8483d6793 100644 --- a/docs/classes/src.DynamicThreadPool.html +++ b/docs/classes/src.DynamicThreadPool.html @@ -1,11 +1,11 @@ -DynamicThreadPool | poolifier - v5.1.6
          poolifier - v5.1.6
            Preparing search index...

            Class DynamicThreadPool<Data, Response>

            A thread pool with a dynamic number of threads, but a guaranteed minimum number of threads.

            +DynamicThreadPool | poolifier - v5.1.7
            poolifier - v5.1.7
              Preparing search index...

              Class DynamicThreadPool<Data, Response>

              A thread pool with a dynamic number of threads, but a guaranteed minimum number of threads.

              This thread pool creates new threads when the others are busy, up to the maximum number of threads. When the maximum number of threads is reached and workers are busy, an event is emitted. If you want to listen to this event, use the pool's emitter.

              0.0.1

              Type Parameters

              • Data = unknown

                Type of data sent to the worker. This can only be structured-cloneable data.

                -
              • Response = unknown

                Type of execution response. This can only be structured-cloneable data.

                -

              Hierarchy (View Summary)

              Index

              Constructors

            • Response = unknown

              Type of execution response. This can only be structured-cloneable data.

              +
            • Hierarchy (View Summary)

              Index

              Constructors

              Properties

              destroying emitter? filePath @@ -59,77 +59,77 @@ When the maximum number of threads is reached and workers are busy, an event is workerMessageListener

              Constructors

              Properties

              destroying: boolean

              Whether the pool is destroying or not.

              -
              emitter?: EventEmitterAsyncResource
              filePath: string

              Path to the worker file.

              -
              maximumNumberOfWorkers?: number

              Maximum number of workers that this pool manages.

              -
              minimumNumberOfWorkers: number

              Minimum number of workers that this pool manages.

              -
              opts: PoolOptions<Worker>

              Options for the pool.

              -
              promiseResponseMap: Map<
                  `${string}-${string}-${string}-${string}-${string}`,
                  PromiseResponseWrapper<Response>,
              > = ...

              The task execution response promise map:

              +
            • max: number

              Maximum number of threads that can be created by this pool.

              +
            • filePath: string

              Path to an implementation of a ThreadWorker file, which can be relative or absolute.

              +
            • opts: ThreadPoolOptions = {}

              Options for this dynamic thread pool.

              +
            • Returns DynamicThreadPool<Data, Response>

              Properties

              destroying: boolean

              Whether the pool is destroying or not.

              +
              emitter?: EventEmitterAsyncResource
              filePath: string

              Path to the worker file.

              +
              maximumNumberOfWorkers?: number

              Maximum number of workers that this pool manages.

              +
              minimumNumberOfWorkers: number

              Minimum number of workers that this pool manages.

              +
              opts: PoolOptions<Worker>

              Options for the pool.

              +
              promiseResponseMap: Map<
                  `${string}-${string}-${string}-${string}-${string}`,
                  PromiseResponseWrapper<Response>,
              > = ...

              The task execution response promise map:

              • key: The message id of each submitted task.
              • value: An object that contains task's worker node key, execution response promise resolve and reject callbacks, async resource.

              When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id.

              -
              started: boolean

              Whether the pool is started or not.

              -
              starting: boolean

              Whether the pool is starting or not.

              -
              workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<
                  Worker,
                  Data,
                  Response,
              >

              Worker choice strategies context referencing worker choice algorithms implementation.

              -
              workerNodes: IWorkerNode<Worker, Data>[] = []

              Accessors

              started: boolean

              Whether the pool is started or not.

              +
              starting: boolean

              Whether the pool is starting or not.

              +
              workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<
                  Worker,
                  Data,
                  Response,
              >

              Worker choice strategies context referencing worker choice algorithms implementation.

              +
              workerNodes: IWorkerNode<Worker, Data>[] = []

              Accessors

              • get backPressure(): boolean

                Whether the pool is back pressured or not.

                Returns boolean

                The pool back pressure boolean status.

                -
              • get busy(): boolean

                Whether the pool is busy or not.

                Returns boolean

                The pool busyness boolean status.

                -
              • get type(): "fixed" | "dynamic"

                The pool type.

                If it is 'dynamic', it provides the max property.

                -

                Returns "fixed" | "dynamic"

              • get worker(): "cluster" | "thread"

                The worker type.

                -

                Returns "cluster" | "thread"

              Methods

              • Hook executed after the worker task execution. +

                Returns "fixed" | "dynamic"

              • get worker(): "cluster" | "thread"

                The worker type.

                +

                Returns "cluster" | "thread"

              Methods

              • Method hooked up after a worker node has been newly created. +

              • message: MessageValue<Response>

                The received message.

                +

              Returns void

              • Hook executed before the worker task execution. +

              Returns void

              • Creates a new, completely set up dynamic worker node.

                +
              • task: Task<Data>

                The task to execute.

                +

              Returns void

              • Terminates the worker node given its worker node key.

                +
              • listener: (message: MessageValue<Message>) => void

                The message listener callback.

                +

              Returns void

              • Parameters

                • Optionaldata: Data
                • Optionalname: string
                • OptionalabortSignal: AbortSignal
                • OptionaltransferList: readonly Transferable[]

                Returns Promise<Response>

              • Gets the worker information given its worker node key.

                +

              Returns Promise<void>

              • Parameters

                • Optionaldata: Data
                • Optionalname: string
                • OptionalabortSignal: AbortSignal
                • OptionaltransferList: readonly Transferable[]

                Returns Promise<Response>

              • Whether the worker nodes are back pressured or not.

                +

              Returns WorkerInfo | undefined

              The worker information.

              +
              • Parameters

                • data: Iterable<Data>
                • Optionalname: string
                • OptionalabortSignals: Iterable<AbortSignal, any, any>
                • OptionaltransferList: readonly Transferable[]

                Returns Promise<Response[]>

              • Parameters

                • data: Iterable<Data>
                • Optionalname: string
                • OptionalabortSignals: Iterable<AbortSignal, any, any>
                • OptionaltransferList: readonly Transferable[]

                Returns Promise<Response[]>

              • Registers a listener callback on the worker given its worker node key.

                +
              • listener: (message: MessageValue<Message>) => void

                The message listener callback.

                +

              Returns void

              • Sends the startup message to worker given its worker node key.

                +
              • listener: (message: MessageValue<Message>) => void

                The message listener callback.

                +

              Returns void

              • Sends a message to worker given its worker node key.

                +

              Returns void

              • Sends a message to worker given its worker node key.

                Parameters

                • workerNodeKey: number

                  The worker node key.

                  -
                • message: MessageValue<Data>

                  The message.

                  -
                • OptionaltransferList: readonly Transferable[]

                  The optional array of transferable objects.

                  -

                Returns void

              • Setup hook to execute code before worker nodes are created in the abstract constructor. +

              • message: MessageValue<Data>

                The message.

                +
              • OptionaltransferList: readonly Transferable[]

                The optional array of transferable objects.

                +

              Returns void

              • Parameters

                • workerChoiceStrategy:
                      | "FAIR_SHARE"
                      | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                      | "LEAST_BUSY"
                      | "LEAST_ELU"
                      | "LEAST_USED"
                      | "ROUND_ROBIN"
                      | "WEIGHTED_ROUND_ROBIN"
                • OptionalworkerChoiceStrategyOptions: WorkerChoiceStrategyOptions

                Returns void

              • Parameters

                • workerChoiceStrategy:
                      | "FAIR_SHARE"
                      | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                      | "LEAST_BUSY"
                      | "LEAST_ELU"
                      | "LEAST_USED"
                      | "ROUND_ROBIN"
                      | "WEIGHTED_ROUND_ROBIN"
                • OptionalworkerChoiceStrategyOptions: WorkerChoiceStrategyOptions

                Returns void

              +

              Returns void

              diff --git a/docs/classes/src.FixedClusterPool.html b/docs/classes/src.FixedClusterPool.html index e06a66147..0e4bd38b6 100644 --- a/docs/classes/src.FixedClusterPool.html +++ b/docs/classes/src.FixedClusterPool.html @@ -1,9 +1,9 @@ -FixedClusterPool | poolifier - v5.1.6
              poolifier - v5.1.6
                Preparing search index...

                Class FixedClusterPool<Data, Response>

                A cluster pool with a fixed number of workers.

                +FixedClusterPool | poolifier - v5.1.7
                poolifier - v5.1.7
                  Preparing search index...

                  Class FixedClusterPool<Data, Response>

                  A cluster pool with a fixed number of workers.

                  2.0.0

                  Type Parameters

                  • Data = unknown

                    Type of data sent to the worker. This can only be structured-cloneable data.

                    -
                  • Response = unknown

                    Type of execution response. This can only be structured-cloneable data.

                    -

                  Hierarchy (View Summary)

                  Index

                  Constructors

                • Response = unknown

                  Type of execution response. This can only be structured-cloneable data.

                  +
                • Hierarchy (View Summary)

                  Index

                  Constructors

                  Properties

                  Constructors

                  • Constructs a new poolifier fixed cluster pool.

                    Type Parameters

                    • Data = unknown
                    • Response = unknown

                    Parameters

                    • numberOfWorkers: number

                      Number of workers for this pool.

                      -
                    • filePath: string

                      Path to an implementation of a ClusterWorker file, which can be relative or absolute.

                      -
                    • opts: ClusterPoolOptions = {}

                      Options for this fixed cluster pool.

                      -
                    • OptionalmaximumNumberOfWorkers: number

                      The maximum number of workers for this pool.

                      -

                    Returns FixedClusterPool<Data, Response>

                  Properties

                  destroying: boolean

                  Whether the pool is destroying or not.

                  -
                  emitter?: EventEmitterAsyncResource
                  filePath: string

                  Path to the worker file.

                  -
                  maximumNumberOfWorkers?: number

                  Maximum number of workers that this pool manages.

                  -
                  minimumNumberOfWorkers: number

                  Minimum number of workers that this pool manages.

                  -
                  opts: PoolOptions<Worker>

                  Options for the pool.

                  -
                  promiseResponseMap: Map<
                      `${string}-${string}-${string}-${string}-${string}`,
                      PromiseResponseWrapper<Response>,
                  > = ...

                  The task execution response promise map:

                  +
                • filePath: string

                  Path to an implementation of a ClusterWorker file, which can be relative or absolute.

                  +
                • opts: ClusterPoolOptions = {}

                  Options for this fixed cluster pool.

                  +
                • OptionalmaximumNumberOfWorkers: number

                  The maximum number of workers for this pool.

                  +
                • Returns FixedClusterPool<Data, Response>

                  Properties

                  destroying: boolean

                  Whether the pool is destroying or not.

                  +
                  emitter?: EventEmitterAsyncResource
                  filePath: string

                  Path to the worker file.

                  +
                  maximumNumberOfWorkers?: number

                  Maximum number of workers that this pool manages.

                  +
                  minimumNumberOfWorkers: number

                  Minimum number of workers that this pool manages.

                  +
                  opts: PoolOptions<Worker>

                  Options for the pool.

                  +
                  promiseResponseMap: Map<
                      `${string}-${string}-${string}-${string}-${string}`,
                      PromiseResponseWrapper<Response>,
                  > = ...

                  The task execution response promise map:

                  • key: The message id of each submitted task.
                  • value: An object that contains task's worker node key, execution response promise resolve and reject callbacks, async resource.

                  When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id.

                  -
                  started: boolean

                  Whether the pool is started or not.

                  -
                  starting: boolean

                  Whether the pool is starting or not.

                  -
                  workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<
                      Worker,
                      Data,
                      Response,
                  >

                  Worker choice strategies context referencing worker choice algorithms implementation.

                  -
                  workerNodes: IWorkerNode<Worker, Data>[] = []

                  Accessors

                  started: boolean

                  Whether the pool is started or not.

                  +
                  starting: boolean

                  Whether the pool is starting or not.

                  +
                  workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<
                      Worker,
                      Data,
                      Response,
                  >

                  Worker choice strategies context referencing worker choice algorithms implementation.

                  +
                  workerNodes: IWorkerNode<Worker, Data>[] = []

                  Accessors

                  • get backPressure(): boolean

                    Whether the pool is back pressured or not.

                    Returns boolean

                    The pool back pressure boolean status.

                    -
                  • get busy(): boolean

                    Whether the pool is busy or not.

                    Returns boolean

                    The pool busyness boolean status.

                    -
                  • get type(): "fixed" | "dynamic"

                    The pool type.

                    If it is 'dynamic', it provides the max property.

                    -

                    Returns "fixed" | "dynamic"

                  • get worker(): "cluster" | "thread"

                    The worker type.

                    -

                    Returns "cluster" | "thread"

                  Methods

                  • Hook executed after the worker task execution. +

                    Returns "fixed" | "dynamic"

                  • get worker(): "cluster" | "thread"

                    The worker type.

                    +

                    Returns "cluster" | "thread"

                  Methods

                  • Method hooked up after a worker node has been newly created. +

                  • message: MessageValue<Response>

                    The received message.

                    +

                  Returns void

                  • Hook executed before the worker task execution. +

                  Returns void

                  • Creates a new, completely set up dynamic worker node.

                    +
                  • task: Task<Data>

                    The task to execute.

                    +

                  Returns void

                  • Terminates the worker node given its worker node key.

                    +
                  • listener: (message: MessageValue<Message>) => void

                    The message listener callback.

                    +

                  Returns void

                  • Parameters

                    • Optionaldata: Data
                    • Optionalname: string
                    • OptionalabortSignal: AbortSignal
                    • OptionaltransferList: readonly Transferable[]

                    Returns Promise<Response>

                  • Gets the worker information given its worker node key.

                    +

                  Returns Promise<void>

                  • Parameters

                    • Optionaldata: Data
                    • Optionalname: string
                    • OptionalabortSignal: AbortSignal
                    • OptionaltransferList: readonly Transferable[]

                    Returns Promise<Response>

                  • Whether the worker nodes are back pressured or not.

                    +

                  Returns WorkerInfo | undefined

                  The worker information.

                  +
                  • Parameters

                    • data: Iterable<Data>
                    • Optionalname: string
                    • OptionalabortSignals: Iterable<AbortSignal, any, any>
                    • OptionaltransferList: readonly Transferable[]

                    Returns Promise<Response[]>

                  • Parameters

                    • data: Iterable<Data>
                    • Optionalname: string
                    • OptionalabortSignals: Iterable<AbortSignal, any, any>
                    • OptionaltransferList: readonly Transferable[]

                    Returns Promise<Response[]>

                  • Registers a listener callback on the worker given its worker node key.

                    +
                  • listener: (message: MessageValue<Message>) => void

                    The message listener callback.

                    +

                  Returns void

                  • Sends the startup message to worker given its worker node key.

                    +
                  • listener: (message: MessageValue<Message>) => void

                    The message listener callback.

                    +

                  Returns void

                  • Sends a message to worker given its worker node key.

                    +

                  Returns void

                  • Setup hook to execute code before worker nodes are created in the abstract constructor. +

                  • message: MessageValue<Data>

                    The message.

                    +

                  Returns void

                  • Parameters

                    • workerChoiceStrategy:
                          | "FAIR_SHARE"
                          | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                          | "LEAST_BUSY"
                          | "LEAST_ELU"
                          | "LEAST_USED"
                          | "ROUND_ROBIN"
                          | "WEIGHTED_ROUND_ROBIN"
                    • OptionalworkerChoiceStrategyOptions: WorkerChoiceStrategyOptions

                    Returns void

                  • Parameters

                    • workerChoiceStrategy:
                          | "FAIR_SHARE"
                          | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                          | "LEAST_BUSY"
                          | "LEAST_ELU"
                          | "LEAST_USED"
                          | "ROUND_ROBIN"
                          | "WEIGHTED_ROUND_ROBIN"
                    • OptionalworkerChoiceStrategyOptions: WorkerChoiceStrategyOptions

                    Returns void

                  +

                  Returns void

                  diff --git a/docs/classes/src.FixedThreadPool.html b/docs/classes/src.FixedThreadPool.html index aa8f79549..29eeb779f 100644 --- a/docs/classes/src.FixedThreadPool.html +++ b/docs/classes/src.FixedThreadPool.html @@ -1,9 +1,9 @@ -FixedThreadPool | poolifier - v5.1.6
                  poolifier - v5.1.6
                    Preparing search index...

                    Class FixedThreadPool<Data, Response>

                    A thread pool with a fixed number of threads.

                    +FixedThreadPool | poolifier - v5.1.7
                    poolifier - v5.1.7
                      Preparing search index...

                      Class FixedThreadPool<Data, Response>

                      A thread pool with a fixed number of threads.

                      0.0.1

                      Type Parameters

                      • Data = unknown

                        Type of data sent to the worker. This can only be structured-cloneable data.

                        -
                      • Response = unknown

                        Type of execution response. This can only be structured-cloneable data.

                        -

                      Hierarchy (View Summary)

                      Index

                      Constructors

                    • Response = unknown

                      Type of execution response. This can only be structured-cloneable data.

                      +
                    • Hierarchy (View Summary)

                      Index

                      Constructors

                      Properties

                      Constructors

                      • Constructs a new poolifier fixed thread pool.

                        Type Parameters

                        • Data = unknown
                        • Response = unknown

                        Parameters

                        • numberOfThreads: number

                          Number of threads for this pool.

                          -
                        • filePath: string

                          Path to an implementation of a ThreadWorker file, which can be relative or absolute.

                          -
                        • opts: ThreadPoolOptions = {}

                          Options for this fixed thread pool.

                          -
                        • OptionalmaximumNumberOfThreads: number

                          The maximum number of threads for this pool.

                          -

                        Returns FixedThreadPool<Data, Response>

                      Properties

                      destroying: boolean

                      Whether the pool is destroying or not.

                      -
                      emitter?: EventEmitterAsyncResource
                      filePath: string

                      Path to the worker file.

                      -
                      maximumNumberOfWorkers?: number

                      Maximum number of workers that this pool manages.

                      -
                      minimumNumberOfWorkers: number

                      Minimum number of workers that this pool manages.

                      -
                      opts: PoolOptions<Worker>

                      Options for the pool.

                      -
                      promiseResponseMap: Map<
                          `${string}-${string}-${string}-${string}-${string}`,
                          PromiseResponseWrapper<Response>,
                      > = ...

                      The task execution response promise map:

                      +
                    • filePath: string

                      Path to an implementation of a ThreadWorker file, which can be relative or absolute.

                      +
                    • opts: ThreadPoolOptions = {}

                      Options for this fixed thread pool.

                      +
                    • OptionalmaximumNumberOfThreads: number

                      The maximum number of threads for this pool.

                      +
                    • Returns FixedThreadPool<Data, Response>

                      Properties

                      destroying: boolean

                      Whether the pool is destroying or not.

                      +
                      emitter?: EventEmitterAsyncResource
                      filePath: string

                      Path to the worker file.

                      +
                      maximumNumberOfWorkers?: number

                      Maximum number of workers that this pool manages.

                      +
                      minimumNumberOfWorkers: number

                      Minimum number of workers that this pool manages.

                      +
                      opts: PoolOptions<Worker>

                      Options for the pool.

                      +
                      promiseResponseMap: Map<
                          `${string}-${string}-${string}-${string}-${string}`,
                          PromiseResponseWrapper<Response>,
                      > = ...

                      The task execution response promise map:

                      • key: The message id of each submitted task.
                      • value: An object that contains task's worker node key, execution response promise resolve and reject callbacks, async resource.

                      When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id.

                      -
                      started: boolean

                      Whether the pool is started or not.

                      -
                      starting: boolean

                      Whether the pool is starting or not.

                      -
                      workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<
                          Worker,
                          Data,
                          Response,
                      >

                      Worker choice strategies context referencing worker choice algorithms implementation.

                      -
                      workerNodes: IWorkerNode<Worker, Data>[] = []

                      Accessors

                      started: boolean

                      Whether the pool is started or not.

                      +
                      starting: boolean

                      Whether the pool is starting or not.

                      +
                      workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<
                          Worker,
                          Data,
                          Response,
                      >

                      Worker choice strategies context referencing worker choice algorithms implementation.

                      +
                      workerNodes: IWorkerNode<Worker, Data>[] = []

                      Accessors

                      • get backPressure(): boolean

                        Whether the pool is back pressured or not.

                        Returns boolean

                        The pool back pressure boolean status.

                        -
                      • get busy(): boolean

                        Whether the pool is busy or not.

                        Returns boolean

                        The pool busyness boolean status.

                        -
                      • get type(): "fixed" | "dynamic"

                        The pool type.

                        If it is 'dynamic', it provides the max property.

                        -

                        Returns "fixed" | "dynamic"

                      • get worker(): "cluster" | "thread"

                        The worker type.

                        -

                        Returns "cluster" | "thread"

                      Methods

                      • Hook executed after the worker task execution. +

                        Returns "fixed" | "dynamic"

                      • get worker(): "cluster" | "thread"

                        The worker type.

                        +

                        Returns "cluster" | "thread"

                      Methods

                      • Method hooked up after a worker node has been newly created. +

                      • message: MessageValue<Response>

                        The received message.

                        +

                      Returns void

                      • Hook executed before the worker task execution. +

                      Returns void

                      • Creates a new, completely set up dynamic worker node.

                        +
                      • task: Task<Data>

                        The task to execute.

                        +

                      Returns void

                      • Terminates the worker node given its worker node key.

                        +
                      • listener: (message: MessageValue<Message>) => void

                        The message listener callback.

                        +

                      Returns void

                      • Parameters

                        • Optionaldata: Data
                        • Optionalname: string
                        • OptionalabortSignal: AbortSignal
                        • OptionaltransferList: readonly Transferable[]

                        Returns Promise<Response>

                      • Gets the worker information given its worker node key.

                        +

                      Returns Promise<void>

                      • Parameters

                        • Optionaldata: Data
                        • Optionalname: string
                        • OptionalabortSignal: AbortSignal
                        • OptionaltransferList: readonly Transferable[]

                        Returns Promise<Response>

                      • Whether the worker nodes are back pressured or not.

                        +

                      Returns WorkerInfo | undefined

                      The worker information.

                      +
                      • Parameters

                        • data: Iterable<Data>
                        • Optionalname: string
                        • OptionalabortSignals: Iterable<AbortSignal, any, any>
                        • OptionaltransferList: readonly Transferable[]

                        Returns Promise<Response[]>

                      • Parameters

                        • data: Iterable<Data>
                        • Optionalname: string
                        • OptionalabortSignals: Iterable<AbortSignal, any, any>
                        • OptionaltransferList: readonly Transferable[]

                        Returns Promise<Response[]>

                      • Registers a listener callback on the worker given its worker node key.

                        +
                      • listener: (message: MessageValue<Message>) => void

                        The message listener callback.

                        +

                      Returns void

                      • Sends the startup message to worker given its worker node key.

                        +
                      • listener: (message: MessageValue<Message>) => void

                        The message listener callback.

                        +

                      Returns void

                      • Sends a message to worker given its worker node key.

                        +

                      Returns void

                      • Sends a message to worker given its worker node key.

                        Parameters

                        • workerNodeKey: number

                          The worker node key.

                          -
                        • message: MessageValue<Data>

                          The message.

                          -
                        • OptionaltransferList: readonly Transferable[]

                          The optional array of transferable objects.

                          -

                        Returns void

                      • Setup hook to execute code before worker nodes are created in the abstract constructor. +

                      • message: MessageValue<Data>

                        The message.

                        +
                      • OptionaltransferList: readonly Transferable[]

                        The optional array of transferable objects.

                        +

                      Returns void

                      • Parameters

                        • workerChoiceStrategy:
                              | "FAIR_SHARE"
                              | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                              | "LEAST_BUSY"
                              | "LEAST_ELU"
                              | "LEAST_USED"
                              | "ROUND_ROBIN"
                              | "WEIGHTED_ROUND_ROBIN"
                        • OptionalworkerChoiceStrategyOptions: WorkerChoiceStrategyOptions

                        Returns void

                      • Parameters

                        • workerChoiceStrategy:
                              | "FAIR_SHARE"
                              | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                              | "LEAST_BUSY"
                              | "LEAST_ELU"
                              | "LEAST_USED"
                              | "ROUND_ROBIN"
                              | "WEIGHTED_ROUND_ROBIN"
                        • OptionalworkerChoiceStrategyOptions: WorkerChoiceStrategyOptions

                        Returns void

                      +

                      Returns void

                      diff --git a/docs/classes/src.ThreadWorker.html b/docs/classes/src.ThreadWorker.html index 5659fd971..7b45cc372 100644 --- a/docs/classes/src.ThreadWorker.html +++ b/docs/classes/src.ThreadWorker.html @@ -1,4 +1,4 @@ -ThreadWorker | poolifier - v5.1.6
                      poolifier - v5.1.6
                        Preparing search index...

                        Class ThreadWorker<Data, Response>

                        A thread worker used by a poolifier ThreadPool.

                        +ThreadWorker | poolifier - v5.1.7
                        poolifier - v5.1.7
                          Preparing search index...

                          Class ThreadWorker<Data, Response>

                          A thread worker used by a poolifier ThreadPool.

                          When this worker is inactive for more than the given maxInactiveTime, it will send a termination request to its main thread.

                          If you use a DynamicThreadPool the extra workers that were created will be terminated, @@ -6,8 +6,8 @@ but the minimum number of workers will be guaranteed.

                          0.0.1

                          Type Parameters

                          • Data = unknown

                            Type of data this worker receives from pool's execution. This can only be structured-cloneable data.

                            -
                          • Response = unknown

                            Type of response the worker sends back to the main thread. This can only be structured-cloneable data.

                            -

                          Hierarchy (View Summary)

                          Index

                          Constructors

                        • Response = unknown

                          Type of response the worker sends back to the main thread. This can only be structured-cloneable data.

                          +
                        • Hierarchy (View Summary)

                          Index

                          Constructors

                          Properties

                          activeInterval? isMain lastTaskTimestamp @@ -34,52 +34,52 @@ but the minimum number of workers will be guaranteed.

                          setDefaultTaskFunction

                          Constructors

                          Properties

                          activeInterval?: Timeout

                          Handler id of the activeInterval worker activity check.

                          -
                          isMain: undefined | boolean

                          Whether this is the main worker or not.

                          -
                          lastTaskTimestamp: number

                          Timestamp of the last task processed by this worker.

                          -
                          opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

                          Options for the worker.

                          -
                          statistics?: WorkerStatistics

                          Performance statistics computation requirements.

                          -
                          taskAbortFunctions: Map<
                              `${string}-${string}-${string}-${string}-${string}`,
                              () => void,
                          >

                          Task abort functions processed by the worker when task operation 'abort' is received.

                          -
                          taskFunctions: Map<string, TaskFunctionObject<Data, Response>>

                          Task function object(s) processed by the worker when the pool's execute method is invoked.

                          -

                          Accessors

                          Methods

                          Returns ThreadWorker<Data, Response>

                          Properties

                          activeInterval?: Timeout

                          Handler id of the activeInterval worker activity check.

                          +
                          isMain: boolean | undefined

                          Whether this is the main worker or not.

                          +
                          lastTaskTimestamp: number

                          Timestamp of the last task processed by this worker.

                          +
                          opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

                          Options for the worker.

                          +
                          statistics?: WorkerStatistics

                          Performance statistics computation requirements.

                          +
                          taskAbortFunctions: Map<
                              `${string}-${string}-${string}-${string}-${string}`,
                              () => void,
                          >

                          Task abort functions processed by the worker when task operation 'abort' is received.

                          +
                          taskFunctions: Map<string, TaskFunctionObject<Data, Response>>

                          Task function object(s) processed by the worker when the pool's execute method is invoked.

                          +

                          Accessors

                          Methods

                          Returns TaskFunctionOperationResult

                          Whether the task function was added or not.

                          +
                          • Handles a worker error.

                            Parameters

                            • error: Error

                              The error raised by the worker.

                              -

                            Returns { aborted: boolean; error: Error; message: string; stack?: string }

                            The worker error object.

                            -
                          • Handles a kill message sent by the main worker.

                            +

                          Returns { aborted: boolean; error: Error; message: string; stack?: string }

                          The worker error object.

                          +
                          • Handles the ready message sent by the main worker.

                            +

                          Returns void

                          Returns void

                          Returns TaskFunctionOperationResult

                          Whether the worker has a task function with the given name or not.

                          +

                          Returns void

                          • Runs the given task.

                            +

                          Returns TaskFunctionOperationResult

                          Whether the task function existed and was removed or not.

                          +

                          Returns void

                          Returns void

                          Returns void

                          Returns void

                          +

                          Returns TaskFunctionOperationResult

                          Whether the default task function was set or not.

                          +
                          diff --git a/docs/documents/api.html b/docs/documents/api.html index ff51a10f2..65d1a85f4 100644 --- a/docs/documents/api.html +++ b/docs/documents/api.html @@ -1,4 +1,4 @@ -api | poolifier - v5.1.6
                          poolifier - v5.1.6
                            Preparing search index...

                            API

                              +api | poolifier - v5.1.7
                              poolifier - v5.1.7
                                Preparing search index...

                                API

                                -

                                numberOfThreads/numberOfWorkers (mandatory) Number of workers for this pool.
                                +

                                numberOfThreads/numberOfWorkers (mandatory) Number of workers for this pool.
                                filePath (mandatory) Path to a file with a worker implementation.
                                opts (optional) An object with the pool options properties described below.

                                -

                                min (mandatory) Same as FixedThreadPool/FixedClusterPool numberOfThreads/numberOfWorkers, this number of workers will be always active.
                                +

                                min (mandatory) Same as FixedThreadPool/FixedClusterPool numberOfThreads/numberOfWorkers, this number of workers will be always active.
                                max (mandatory) Max number of workers that this pool can contain, the newly created workers will die after a threshold (default is 1 minute, you can override it in your worker implementation).
                                filePath (mandatory) Path to a file with a worker implementation.
                                opts (optional) An object with the pool options properties described below.

                                -

                                data (optional) An object that you want to pass to your worker task function implementation.
                                +

                                data (optional) An object that you want to pass to your worker task function implementation.
                                name (optional) A string with the task function name that you want to execute on the worker. Default: 'default'
                                abortSignal (optional) An abort signal to abort the task function execution.
                                transferList (optional) An array of transferable objects that you want to transfer to your ThreadWorker worker implementation.

                                This method is available on both pool implementations and returns a promise with the task function execution response.

                                -

                                data An iterable of objects that you want to pass to your worker task function implementation.
                                +

                                data An iterable of objects that you want to pass to your worker task function implementation.
                                name (optional) A string with the task function name that you want to execute on the worker. Default: 'default'
                                abortSignals (optional) An iterable of AbortSignal to abort the matching object task function execution.
                                transferList (optional) An array of transferable objects that you want to transfer to your ThreadWorker worker implementation.

                                This method is available on both pool implementations and returns a promise with the task function execution responses array.

                                -

                                This method is available on both pool implementations and will start the minimum number of workers.

                                -

                                This method is available on both pool implementations and will call the terminate method on each worker.

                                -

                                name (mandatory) The task function name.

                                +

                                This method is available on both pool implementations and will start the minimum number of workers.

                                +

                                This method is available on both pool implementations and will call the terminate method on each worker.

                                +

                                name (mandatory) The task function name.

                                This method is available on both pool implementations and returns a boolean.

                                -

                                name (mandatory) The task function name.
                                +

                                name (mandatory) The task function name.
                                fn (mandatory) The task function (data?: Data) => Response | Promise<Response> or task function object { taskFunction: (data?: Data) => Response | Promise<Response>, priority?: number, strategy?: WorkerChoiceStrategy }. Priority range is the same as Unix nice levels.

                                This method is available on both pool implementations and returns a boolean promise.

                                -

                                name (mandatory) The task function name.

                                +

                                name (mandatory) The task function name.

                                This method is available on both pool implementations and returns a boolean promise.

                                -

                                This method is available on both pool implementations and returns an array of the task function properties.

                                -

                                name (mandatory) The task function name.

                                +

                                This method is available on both pool implementations and returns an array of the task function properties.

                                +

                                name (mandatory) The task function name.

                                This method is available on both pool implementations and returns a boolean promise.

                                An object with these properties:

                                  @@ -88,7 +88,7 @@ Default: () => {}

                                • WorkerChoiceStrategies.FAIR_SHARE: Submit tasks to worker by using a fair share scheduling algorithm based on tasks execution time (the default) or ELU active time

                                WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN, WorkerChoiceStrategies.INTERLEAVED_WEIGHTED_ROUND_ROBIN and WorkerChoiceStrategies.FAIR_SHARE strategies are targeted to heavy and long tasks.
                                -Default: WorkerChoiceStrategies.ROUND_ROBIN

                                +Default: WorkerChoiceStrategies.LEAST_USED

                              • workerChoiceStrategyOptions (optional) - The worker choice strategy options object to use in this pool.
                                @@ -141,7 +141,7 @@ Properties:

                                settings (optional) - An object with the cluster settings. See cluster for more details.

                              -

                              taskFunctions (mandatory) The task function or task functions object Record<string, (data?: Data) => Response | Promise<Response> | { taskFunction: (data?: Data) => Response | Promise<Response>, priority?: number, strategy?: WorkerChoiceStrategy }> that you want to execute on the worker. Priority range is the same as Unix nice levels.
                              +

                              taskFunctions (mandatory) The task function or task functions object Record<string, (data?: Data) => Response | Promise<Response> | { taskFunction: (data?: Data) => Response | Promise<Response>, priority?: number, strategy?: WorkerChoiceStrategy }> that you want to execute on the worker. Priority range is the same as Unix nice levels.
                              opts (optional) An object with these properties:

                              • @@ -163,14 +163,14 @@ Default: 60000

                                Default: () => {}

                              -

                              name (mandatory) The task function name.

                              +

                              name (mandatory) The task function name.

                              This method is available on both worker implementations and returns { status: boolean, error?: Error }.

                              -

                              name (mandatory) The task function name.
                              +

                              name (mandatory) The task function name.
                              fn (mandatory) The task function (data?: Data) => Response | Promise<Response> or task function object { taskFunction: (data?: Data) => Response | Promise<Response>, priority?: number, strategy?: WorkerChoiceStrategy }. Priority range is the same as Unix nice levels.

                              This method is available on both worker implementations and returns { status: boolean, error?: Error }.

                              -

                              name (mandatory) The task function name.

                              +

                              name (mandatory) The task function name.

                              This method is available on both worker implementations and returns { status: boolean, error?: Error }.

                              -

                              This method is available on both worker implementations and returns an array of the task function properties.

                              -

                              name (mandatory) The task function name.

                              +

                              This method is available on both worker implementations and returns an array of the task function properties.

                              +

                              name (mandatory) The task function name.

                              This method is available on both worker implementations and returns { status: boolean, error?: Error }.

                              -
                              +
                              diff --git a/docs/documents/general-guidelines.html b/docs/documents/general-guidelines.html index a0a6ca3a1..d3d90e2ba 100644 --- a/docs/documents/general-guidelines.html +++ b/docs/documents/general-guidelines.html @@ -1,4 +1,4 @@ -general-guidelines | poolifier - v5.1.6
                              poolifier - v5.1.6
                                Preparing search index...

                                General guidelines

                                Performance is one of the main target of these worker pool implementations, poolifier team wants to have a strong focus on this.
                                +general-guidelines | poolifier - v5.1.7

                                poolifier - v5.1.7
                                  Preparing search index...

                                  General guidelines

                                  Performance is one of the main target of these worker pool implementations, poolifier team wants to have a strong focus on this.
                                  Poolifier already has benchmarks where you can find some comparisons.

                                  • Internal Node.js thread pool
                                  • @@ -27,4 +27,4 @@ By doing so, your application will be ready to execute in parallel more tasks, b One good choice from poolifier team point of view is to profile your application using a fixed or dynamic worker pool, and analyze your application metrics when you increase/decrease the number of workers.
                                    For example you could keep the memory footprint low by choosing a DynamicThreadPool/DynamicClusterPool with a minimum of 5 workers, and allowing it to create new workers until a maximum of 50 workers if needed. This is the advantage of using a DynamicThreadPool/DynamicClusterPool.
                                    But in general, always profile your application.

                                    -
                                  +
                                  diff --git a/docs/documents/worker-choice-strategies.html b/docs/documents/worker-choice-strategies.html index f3e2da108..fa3906d10 100644 --- a/docs/documents/worker-choice-strategies.html +++ b/docs/documents/worker-choice-strategies.html @@ -1,4 +1,4 @@ -worker-choice-strategies | poolifier - v5.1.6
                                  poolifier - v5.1.6
                                    Preparing search index...

                                    Worker choice strategies

                                    All duration or timestamp are expressed in milliseconds.

                                    +worker-choice-strategies | poolifier - v5.1.7
                                    poolifier - v5.1.7
                                      Preparing search index...

                                      Worker choice strategies

                                      All duration or timestamp are expressed in milliseconds.

                                      • Strategies
                                          @@ -21,4 +21,4 @@ During a round, if the worker weight is superior or equal to the current round w The default worker weights is the same for each and computed given the CPU cores speed and theirs numbers. So the default 'rounds' consists of a unique worker weight.

                                          Worker choice strategies enable only the statistics that are needed to choose the next worker to avoid unnecessary overhead.

                                          Strategies using the simple moving average task execution time for each worker can use the simple moving median instead. Simple moving median is more robust to outliers and can be used to avoid assigning tasks to workers that are currently overloaded.

                                          -
                                      +
                                      diff --git a/docs/functions/src.availableParallelism.html b/docs/functions/src.availableParallelism.html index 53dbb7c42..4bd14167c 100644 --- a/docs/functions/src.availableParallelism.html +++ b/docs/functions/src.availableParallelism.html @@ -1,4 +1,4 @@ -availableParallelism | poolifier - v5.1.6
                                      poolifier - v5.1.6
                                        Preparing search index...

                                        Function availableParallelism

                                        • Returns safe host OS optimized estimate of the default amount of parallelism a pool should use. +availableParallelism | poolifier - v5.1.7

                                          poolifier - v5.1.7
                                            Preparing search index...

                                            Function availableParallelism

                                            • Returns safe host OS optimized estimate of the default amount of parallelism a pool should use. Always returns a value greater than zero.

                                              Returns number

                                              The host OS optimized maximum pool size.

                                              -
                                            +
                                          diff --git a/docs/hierarchy.html b/docs/hierarchy.html index d03c7847b..2c1086ae7 100644 --- a/docs/hierarchy.html +++ b/docs/hierarchy.html @@ -1 +1 @@ -poolifier - v5.1.6
                                          poolifier - v5.1.6
                                            Preparing search index...
                                            +poolifier - v5.1.7
                                            poolifier - v5.1.7
                                              Preparing search index...
                                              diff --git a/docs/index.html b/docs/index.html index 5127eedad..79cc52c77 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -poolifier - v5.1.6
                                              poolifier - v5.1.6
                                                Preparing search index...

                                                poolifier - v5.1.6

                                                Documents

                                                api
                                                general-guidelines
                                                worker-choice-strategies

                                                Modules

                                                src
                                                +poolifier - v5.1.7
                                                poolifier - v5.1.7
                                                  Preparing search index...

                                                  poolifier - v5.1.7

                                                  Documents

                                                  api
                                                  general-guidelines
                                                  worker-choice-strategies

                                                  Modules

                                                  src
                                                  diff --git a/docs/interfaces/src.AbstractPool.html b/docs/interfaces/src.AbstractPool.html index 75a498c97..cc22339d3 100644 --- a/docs/interfaces/src.AbstractPool.html +++ b/docs/interfaces/src.AbstractPool.html @@ -1,8 +1,8 @@ -AbstractPool | poolifier - v5.1.6
                                                  poolifier - v5.1.6
                                                    Preparing search index...

                                                    Interface AbstractPool<Worker, Data, Response>Abstract

                                                    Base class that implements some shared logic for all poolifier pools.

                                                    -
                                                    interface AbstractPool<
                                                        Worker extends IWorker,
                                                        Data = unknown,
                                                        Response = unknown,
                                                    > {
                                                        destroying: boolean;
                                                        emitter?: EventEmitterAsyncResource;
                                                        filePath: string;
                                                        maximumNumberOfWorkers?: number;
                                                        minimumNumberOfWorkers: number;
                                                        opts: PoolOptions<Worker>;
                                                        promiseResponseMap: Map<
                                                            `${string}-${string}-${string}-${string}-${string}`,
                                                            PromiseResponseWrapper<Response>,
                                                        >;
                                                        started: boolean;
                                                        starting: boolean;
                                                        workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<
                                                            Worker,
                                                            Data,
                                                            Response,
                                                        >;
                                                        workerNodes: IWorkerNode<Worker, Data>[];
                                                        get backPressure(): boolean;
                                                        get busy(): boolean;
                                                        get info(): PoolInfo;
                                                        get type(): "fixed" | "dynamic";
                                                        get worker(): "cluster" | "thread";
                                                        addTaskFunction(
                                                            name: string,
                                                            fn: TaskFunction<Data, Response> | TaskFunctionObject<Data, Response>,
                                                        ): Promise<boolean>;
                                                        afterTaskExecutionHook(
                                                            workerNodeKey: number,
                                                            message: MessageValue<Response>,
                                                        ): void;
                                                        afterWorkerNodeSetup(workerNodeKey: number): void;
                                                        beforeTaskExecutionHook(workerNodeKey: number, task: Task<Data>): void;
                                                        checkAndEmitDynamicWorkerCreationEvents(): void;
                                                        checkAndEmitDynamicWorkerDestructionEvents(): void;
                                                        createAndSetupDynamicWorkerNode(): number;
                                                        createAndSetupWorkerNode(): number;
                                                        deregisterWorkerMessageListener<Message>(
                                                            workerNodeKey: number,
                                                            listener: (message: MessageValue<Message>) => void,
                                                        ): void;
                                                        destroy(): Promise<void>;
                                                        destroyWorkerNode(workerNodeKey: number): Promise<void>;
                                                        enableTasksQueue(
                                                            enable: boolean,
                                                            tasksQueueOptions?: TasksQueueOptions,
                                                        ): void;
                                                        execute(
                                                            data?: Data,
                                                            name?: string,
                                                            abortSignal?: AbortSignal,
                                                            transferList?: readonly Transferable[],
                                                        ): Promise<Response>;
                                                        flagWorkerNodeAsNotReady(workerNodeKey: number): void;
                                                        flushTasksQueue(workerNodeKey: number): number;
                                                        getWorkerInfo(workerNodeKey: number): undefined | WorkerInfo;
                                                        hasTaskFunction(name: string): boolean;
                                                        internalBackPressure(): boolean;
                                                        internalBusy(): boolean;
                                                        isMain(): boolean;
                                                        listTaskFunctionsProperties(): TaskFunctionProperties[];
                                                        mapExecute(
                                                            data: Iterable<Data>,
                                                            name?: string,
                                                            abortSignals?: Iterable<AbortSignal, any, any>,
                                                            transferList?: readonly Transferable[],
                                                        ): Promise<Response[]>;
                                                        registerOnceWorkerMessageListener<Message>(
                                                            workerNodeKey: number,
                                                            listener: (message: MessageValue<Message>) => void,
                                                        ): void;
                                                        registerWorkerMessageListener<Message>(
                                                            workerNodeKey: number,
                                                            listener: (message: MessageValue<Message>) => void,
                                                        ): void;
                                                        removeTaskFunction(name: string): Promise<boolean>;
                                                        sendStartupMessageToWorker(workerNodeKey: number): void;
                                                        sendToWorker(
                                                            workerNodeKey: number,
                                                            message: MessageValue<Data>,
                                                            transferList?: readonly Transferable[],
                                                        ): void;
                                                        setDefaultTaskFunction(name: string): Promise<boolean>;
                                                        setTasksQueueOptions(
                                                            tasksQueueOptions: undefined | TasksQueueOptions,
                                                        ): void;
                                                        setupHook(): void;
                                                        setWorkerChoiceStrategy(
                                                            workerChoiceStrategy:
                                                                | "FAIR_SHARE"
                                                                | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                | "LEAST_BUSY"
                                                                | "LEAST_ELU"
                                                                | "LEAST_USED"
                                                                | "ROUND_ROBIN"
                                                                | "WEIGHTED_ROUND_ROBIN",
                                                            workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions,
                                                        ): void;
                                                        setWorkerChoiceStrategyOptions(
                                                            workerChoiceStrategyOptions: undefined | WorkerChoiceStrategyOptions,
                                                        ): boolean;
                                                        shallCreateDynamicWorker(): boolean;
                                                        start(): void;
                                                        workerMessageListener(message: MessageValue<Response>): void;
                                                    }

                                                    Type Parameters

                                                    • Worker extends IWorker

                                                      Type of worker which manages this pool.

                                                      -
                                                    • Data = unknown

                                                      Type of data sent to the worker. This can only be structured-cloneable data.

                                                      -
                                                    • Response = unknown

                                                      Type of execution response. This can only be structured-cloneable data.

                                                      -

                                                    Hierarchy (View Summary)

                                                    Implements

                                                    Index

                                                    Properties

                                                    destroying +AbstractPool | poolifier - v5.1.7
                                                    poolifier - v5.1.7
                                                      Preparing search index...

                                                      Interface AbstractPool<Worker, Data, Response>Abstract

                                                      Base class that implements some shared logic for all poolifier pools.

                                                      +
                                                      interface AbstractPool<
                                                          Worker extends IWorker,
                                                          Data = unknown,
                                                          Response = unknown,
                                                      > {
                                                          destroying: boolean;
                                                          emitter?: EventEmitterAsyncResource;
                                                          filePath: string;
                                                          maximumNumberOfWorkers?: number;
                                                          minimumNumberOfWorkers: number;
                                                          opts: PoolOptions<Worker>;
                                                          promiseResponseMap: Map<
                                                              `${string}-${string}-${string}-${string}-${string}`,
                                                              PromiseResponseWrapper<Response>,
                                                          >;
                                                          started: boolean;
                                                          starting: boolean;
                                                          workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<
                                                              Worker,
                                                              Data,
                                                              Response,
                                                          >;
                                                          workerNodes: IWorkerNode<Worker, Data>[];
                                                          get backPressure(): boolean;
                                                          get busy(): boolean;
                                                          get info(): PoolInfo;
                                                          get type(): "fixed" | "dynamic";
                                                          get worker(): "cluster" | "thread";
                                                          addTaskFunction(
                                                              name: string,
                                                              fn: TaskFunction<Data, Response> | TaskFunctionObject<Data, Response>,
                                                          ): Promise<boolean>;
                                                          afterTaskExecutionHook(
                                                              workerNodeKey: number,
                                                              message: MessageValue<Response>,
                                                          ): void;
                                                          afterWorkerNodeSetup(workerNodeKey: number): void;
                                                          beforeTaskExecutionHook(workerNodeKey: number, task: Task<Data>): void;
                                                          checkAndEmitDynamicWorkerCreationEvents(): void;
                                                          checkAndEmitDynamicWorkerDestructionEvents(): void;
                                                          createAndSetupDynamicWorkerNode(): number;
                                                          createAndSetupWorkerNode(): number;
                                                          deregisterWorkerMessageListener<Message>(
                                                              workerNodeKey: number,
                                                              listener: (message: MessageValue<Message>) => void,
                                                          ): void;
                                                          destroy(): Promise<void>;
                                                          destroyWorkerNode(workerNodeKey: number): Promise<void>;
                                                          enableTasksQueue(
                                                              enable: boolean,
                                                              tasksQueueOptions?: TasksQueueOptions,
                                                          ): void;
                                                          execute(
                                                              data?: Data,
                                                              name?: string,
                                                              abortSignal?: AbortSignal,
                                                              transferList?: readonly Transferable[],
                                                          ): Promise<Response>;
                                                          flagWorkerNodeAsNotReady(workerNodeKey: number): void;
                                                          flushTasksQueue(workerNodeKey: number): number;
                                                          getWorkerInfo(workerNodeKey: number): WorkerInfo | undefined;
                                                          hasTaskFunction(name: string): boolean;
                                                          internalBackPressure(): boolean;
                                                          internalBusy(): boolean;
                                                          isMain(): boolean;
                                                          listTaskFunctionsProperties(): TaskFunctionProperties[];
                                                          mapExecute(
                                                              data: Iterable<Data>,
                                                              name?: string,
                                                              abortSignals?: Iterable<AbortSignal, any, any>,
                                                              transferList?: readonly Transferable[],
                                                          ): Promise<Response[]>;
                                                          registerOnceWorkerMessageListener<Message>(
                                                              workerNodeKey: number,
                                                              listener: (message: MessageValue<Message>) => void,
                                                          ): void;
                                                          registerWorkerMessageListener<Message>(
                                                              workerNodeKey: number,
                                                              listener: (message: MessageValue<Message>) => void,
                                                          ): void;
                                                          removeTaskFunction(name: string): Promise<boolean>;
                                                          sendStartupMessageToWorker(workerNodeKey: number): void;
                                                          sendToWorker(
                                                              workerNodeKey: number,
                                                              message: MessageValue<Data>,
                                                              transferList?: readonly Transferable[],
                                                          ): void;
                                                          setDefaultTaskFunction(name: string): Promise<boolean>;
                                                          setTasksQueueOptions(
                                                              tasksQueueOptions: TasksQueueOptions | undefined,
                                                          ): void;
                                                          setupHook(): void;
                                                          setWorkerChoiceStrategy(
                                                              workerChoiceStrategy:
                                                                  | "FAIR_SHARE"
                                                                  | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                  | "LEAST_BUSY"
                                                                  | "LEAST_ELU"
                                                                  | "LEAST_USED"
                                                                  | "ROUND_ROBIN"
                                                                  | "WEIGHTED_ROUND_ROBIN",
                                                              workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions,
                                                          ): void;
                                                          setWorkerChoiceStrategyOptions(
                                                              workerChoiceStrategyOptions: WorkerChoiceStrategyOptions | undefined,
                                                          ): boolean;
                                                          shallCreateDynamicWorker(): boolean;
                                                          start(): void;
                                                          workerMessageListener(message: MessageValue<Response>): void;
                                                      }

                                                      Type Parameters

                                                      • Worker extends IWorker

                                                        Type of worker which manages this pool.

                                                        +
                                                      • Data = unknown

                                                        Type of data sent to the worker. This can only be structured-cloneable data.

                                                        +
                                                      • Response = unknown

                                                        Type of execution response. This can only be structured-cloneable data.

                                                        +

                                                      Hierarchy (View Summary)

                                                      Implements

                                                      Index

                                                      Properties

                                                      destroying: boolean

                                                      Whether the pool is destroying or not.

                                                      -
                                                      emitter?: EventEmitterAsyncResource
                                                      filePath: string

                                                      Path to the worker file.

                                                      -
                                                      maximumNumberOfWorkers?: number

                                                      Maximum number of workers that this pool manages.

                                                      -
                                                      minimumNumberOfWorkers: number

                                                      Minimum number of workers that this pool manages.

                                                      -

                                                      Options for the pool.

                                                      -
                                                      promiseResponseMap: Map<
                                                          `${string}-${string}-${string}-${string}-${string}`,
                                                          PromiseResponseWrapper<Response>,
                                                      > = ...

                                                      The task execution response promise map:

                                                      +
                                                      emitter?: EventEmitterAsyncResource
                                                      filePath: string

                                                      Path to the worker file.

                                                      +
                                                      maximumNumberOfWorkers?: number

                                                      Maximum number of workers that this pool manages.

                                                      +
                                                      minimumNumberOfWorkers: number

                                                      Minimum number of workers that this pool manages.

                                                      +

                                                      Options for the pool.

                                                      +
                                                      promiseResponseMap: Map<
                                                          `${string}-${string}-${string}-${string}-${string}`,
                                                          PromiseResponseWrapper<Response>,
                                                      > = ...

                                                      The task execution response promise map:

                                                      • key: The message id of each submitted task.
                                                      • value: An object that contains task's worker node key, execution response promise resolve and reject callbacks, async resource.

                                                      When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id.

                                                      -
                                                      started: boolean

                                                      Whether the pool is started or not.

                                                      -
                                                      starting: boolean

                                                      Whether the pool is starting or not.

                                                      -
                                                      workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<
                                                          Worker,
                                                          Data,
                                                          Response,
                                                      >

                                                      Worker choice strategies context referencing worker choice algorithms implementation.

                                                      -
                                                      workerNodes: IWorkerNode<Worker, Data>[] = []

                                                      Accessors

                                                      started: boolean

                                                      Whether the pool is started or not.

                                                      +
                                                      starting: boolean

                                                      Whether the pool is starting or not.

                                                      +
                                                      workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<
                                                          Worker,
                                                          Data,
                                                          Response,
                                                      >

                                                      Worker choice strategies context referencing worker choice algorithms implementation.

                                                      +
                                                      workerNodes: IWorkerNode<Worker, Data>[] = []

                                                      Accessors

                                                      • get backPressure(): boolean

                                                        Whether the pool is back pressured or not.

                                                        Returns boolean

                                                        The pool back pressure boolean status.

                                                        -
                                                      • get type(): "fixed" | "dynamic"

                                                        The pool type.

                                                        If it is 'dynamic', it provides the max property.

                                                        -

                                                        Returns "fixed" | "dynamic"

                                                      Methods

                                                      Methods

                                                      • Method hooked up after a worker node has been newly created. +

                                                      • message: MessageValue<Response>

                                                        The received message.

                                                        +

                                                      Returns void

                                                      • Method hooked up after a worker node has been newly created. Can be overridden.

                                                        Parameters

                                                        • workerNodeKey: number

                                                          The newly created worker node key.

                                                          -

                                                        Returns void

                                                      • Hook executed before the worker task execution. +

                                                      Returns void

                                                      • Hook executed before the worker task execution. Can be overridden.

                                                        Parameters

                                                        • workerNodeKey: number

                                                          The worker node key.

                                                          -
                                                        • task: Task<Data>

                                                          The task to execute.

                                                          -

                                                        Returns void

                                                      • Creates a new, completely set up dynamic worker node.

                                                        +
                                                      • task: Task<Data>

                                                        The task to execute.

                                                        +

                                                      Returns void

                                                      • Creates a new, completely set up dynamic worker node.

                                                        Returns number

                                                        New, completely set up dynamic worker node key.

                                                        -
                                                      • Creates a new, completely set up worker node.

                                                        Returns number

                                                        New, completely set up worker node key.

                                                        -
                                                      • Deregisters a listener callback on the worker given its worker node key.

                                                        Type Parameters

                                                        • Message

                                                        Parameters

                                                        • workerNodeKey: number

                                                          The worker node key.

                                                          -
                                                        • listener: (message: MessageValue<Message>) => void

                                                          The message listener callback.

                                                          -

                                                        Returns void

                                                      • Terminates the worker node given its worker node key.

                                                        +
                                                      • listener: (message: MessageValue<Message>) => void

                                                        The message listener callback.

                                                        +

                                                      Returns void

                                                      • Terminates the worker node given its worker node key.

                                                        Parameters

                                                        • workerNodeKey: number

                                                          The worker node key.

                                                          -

                                                        Returns Promise<void>

                                                      • Parameters

                                                        • Optionaldata: Data
                                                        • Optionalname: string
                                                        • OptionalabortSignal: AbortSignal
                                                        • OptionaltransferList: readonly Transferable[]

                                                        Returns Promise<Response>

                                                      • Gets the worker information given its worker node key.

                                                        +

                                                      Returns Promise<void>

                                                      • Parameters

                                                        • Optionaldata: Data
                                                        • Optionalname: string
                                                        • OptionalabortSignal: AbortSignal
                                                        • OptionaltransferList: readonly Transferable[]

                                                        Returns Promise<Response>

                                                      • Gets the worker information given its worker node key.

                                                        Parameters

                                                        • workerNodeKey: number

                                                          The worker node key.

                                                          -

                                                        Returns undefined | WorkerInfo

                                                        The worker information.

                                                        -
                                                      • Parameters

                                                        • name: string

                                                        Returns boolean

                                                      • Whether the worker nodes are back pressured or not.

                                                        +

                                                      Returns WorkerInfo | undefined

                                                      The worker information.

                                                      +
                                                      • Parameters

                                                        • name: string

                                                        Returns boolean

                                                      • Whether the worker nodes are back pressured or not.

                                                        Returns boolean

                                                        Worker nodes back pressure boolean status.

                                                        -
                                                      • Whether worker nodes are executing concurrently their tasks quota or not.

                                                        Returns boolean

                                                        Worker nodes busyness boolean status.

                                                        -
                                                      • Returns whether the worker is the main worker or not.

                                                        Returns boolean

                                                        true if the worker is the main worker, false otherwise.

                                                        -
                                                      • Parameters

                                                        • data: Iterable<Data>
                                                        • Optionalname: string
                                                        • OptionalabortSignals: Iterable<AbortSignal, any, any>
                                                        • OptionaltransferList: readonly Transferable[]

                                                        Returns Promise<Response[]>

                                                      • Parameters

                                                        • data: Iterable<Data>
                                                        • Optionalname: string
                                                        • OptionalabortSignals: Iterable<AbortSignal, any, any>
                                                        • OptionaltransferList: readonly Transferable[]

                                                        Returns Promise<Response[]>

                                                      • Registers once a listener callback on the worker given its worker node key.

                                                        Type Parameters

                                                        • Message

                                                        Parameters

                                                        • workerNodeKey: number

                                                          The worker node key.

                                                          -
                                                        • listener: (message: MessageValue<Message>) => void

                                                          The message listener callback.

                                                          -

                                                        Returns void

                                                      • Registers a listener callback on the worker given its worker node key.

                                                        +
                                                      • listener: (message: MessageValue<Message>) => void

                                                        The message listener callback.

                                                        +

                                                      Returns void

                                                      • Registers a listener callback on the worker given its worker node key.

                                                        Type Parameters

                                                        • Message

                                                        Parameters

                                                        • workerNodeKey: number

                                                          The worker node key.

                                                          -
                                                        • listener: (message: MessageValue<Message>) => void

                                                          The message listener callback.

                                                          -

                                                        Returns void

                                                      • Parameters

                                                        • name: string

                                                        Returns Promise<boolean>

                                                      • Sends the startup message to worker given its worker node key.

                                                        +
                                                      • listener: (message: MessageValue<Message>) => void

                                                        The message listener callback.

                                                        +

                                                      Returns void

                                                      • Parameters

                                                        • name: string

                                                        Returns Promise<boolean>

                                                      • Sends the startup message to worker given its worker node key.

                                                        Parameters

                                                        • workerNodeKey: number

                                                          The worker node key.

                                                          -

                                                        Returns void

                                                      • Sends a message to worker given its worker node key.

                                                        +

                                                      Returns void

                                                      • Sends a message to worker given its worker node key.

                                                        Parameters

                                                        • workerNodeKey: number

                                                          The worker node key.

                                                          -
                                                        • message: MessageValue<Data>

                                                          The message.

                                                          -
                                                        • OptionaltransferList: readonly Transferable[]

                                                          The optional array of transferable objects.

                                                          -

                                                        Returns void

                                                      • Parameters

                                                        • name: string

                                                        Returns Promise<boolean>

                                                      • Setup hook to execute code before worker nodes are created in the abstract constructor. +

                                                      • message: MessageValue<Data>

                                                        The message.

                                                        +
                                                      • OptionaltransferList: readonly Transferable[]

                                                        The optional array of transferable objects.

                                                        +

                                                      Returns void

                                                      • Parameters

                                                        • name: string

                                                        Returns Promise<boolean>

                                                      • Setup hook to execute code before worker nodes are created in the abstract constructor. Can be overridden.

                                                        -

                                                        Returns void

                                                      • Parameters

                                                        • workerChoiceStrategy:
                                                              | "FAIR_SHARE"
                                                              | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                              | "LEAST_BUSY"
                                                              | "LEAST_ELU"
                                                              | "LEAST_USED"
                                                              | "ROUND_ROBIN"
                                                              | "WEIGHTED_ROUND_ROBIN"
                                                        • OptionalworkerChoiceStrategyOptions: WorkerChoiceStrategyOptions

                                                        Returns void

                                                      • Parameters

                                                        • workerChoiceStrategy:
                                                              | "FAIR_SHARE"
                                                              | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                              | "LEAST_BUSY"
                                                              | "LEAST_ELU"
                                                              | "LEAST_USED"
                                                              | "ROUND_ROBIN"
                                                              | "WEIGHTED_ROUND_ROBIN"
                                                        • OptionalworkerChoiceStrategyOptions: WorkerChoiceStrategyOptions

                                                        Returns void

                                                      • Conditions for dynamic worker creation.

                                                        Returns boolean

                                                        Whether to create a dynamic worker or not.

                                                        -
                                                      +

                                                      Returns void

                                                      diff --git a/docs/interfaces/src.AbstractWorker.html b/docs/interfaces/src.AbstractWorker.html index c67f41aad..c5c97f538 100644 --- a/docs/interfaces/src.AbstractWorker.html +++ b/docs/interfaces/src.AbstractWorker.html @@ -1,8 +1,8 @@ -AbstractWorker | poolifier - v5.1.6
                                                      poolifier - v5.1.6
                                                        Preparing search index...

                                                        Interface AbstractWorker<MainWorker, Data, Response>Abstract

                                                        Base class that implements some shared logic for all poolifier workers.

                                                        -
                                                        interface AbstractWorker<
                                                            MainWorker extends MessagePort
                                                            | Worker,
                                                            Data = unknown,
                                                            Response = unknown,
                                                        > {
                                                            activeInterval?: Timeout;
                                                            id: number;
                                                            isMain: undefined | boolean;
                                                            lastTaskTimestamp: number;
                                                            opts: WorkerOptions;
                                                            statistics?: WorkerStatistics;
                                                            taskAbortFunctions: Map<
                                                                `${string}-${string}-${string}-${string}-${string}`,
                                                                () => void,
                                                            >;
                                                            taskFunctions: Map<string, TaskFunctionObject<Data, Response>>;
                                                            addTaskFunction(
                                                                name: string,
                                                                fn: TaskFunctionObject<Data, Response> | TaskFunction<Data, Response>,
                                                            ): TaskFunctionOperationResult;
                                                            getMainWorker(): MainWorker;
                                                            handleError(
                                                                error: Error,
                                                            ): { aborted: boolean; error?: Error; message: string; stack?: string };
                                                            handleKillMessage(message: MessageValue<Data>): void;
                                                            handleReadyMessage(message: MessageValue<Data>): void;
                                                            handleTaskFunctionOperationMessage(message: MessageValue<Data>): void;
                                                            hasTaskFunction(name: string): TaskFunctionOperationResult;
                                                            listTaskFunctionsProperties(): TaskFunctionProperties[];
                                                            messageListener(message: MessageValue<Data>): void;
                                                            removeTaskFunction(name: string): TaskFunctionOperationResult;
                                                            run(task: Task<Data>): void;
                                                            runAsync(fn: TaskAsyncFunction<Data, Response>, task: Task<Data>): void;
                                                            runSync(fn: TaskSyncFunction<Data, Response>, task: Task<Data>): void;
                                                            sendTaskFunctionsPropertiesToMainWorker(): void;
                                                            sendToMainWorker(message: MessageValue<Response, Data>): void;
                                                            setDefaultTaskFunction(name: string): TaskFunctionOperationResult;
                                                        }

                                                        Type Parameters

                                                        • MainWorker extends MessagePort | Worker

                                                          Type of main worker.

                                                          -
                                                        • Data = unknown

                                                          Type of data this worker receives from pool's execution. This can only be structured-cloneable data.

                                                          -
                                                        • Response = unknown

                                                          Type of response the worker sends back to the main worker. This can only be structured-cloneable data.

                                                          -

                                                        Hierarchy (View Summary)

                                                        Index

                                                        Properties

                                                        activeInterval? +AbstractWorker | poolifier - v5.1.7
                                                        poolifier - v5.1.7
                                                          Preparing search index...

                                                          Interface AbstractWorker<MainWorker, Data, Response>Abstract

                                                          Base class that implements some shared logic for all poolifier workers.

                                                          +
                                                          interface AbstractWorker<
                                                              MainWorker extends MessagePort
                                                              | Worker,
                                                              Data = unknown,
                                                              Response = unknown,
                                                          > {
                                                              activeInterval?: Timeout;
                                                              id: number;
                                                              isMain: boolean | undefined;
                                                              lastTaskTimestamp: number;
                                                              opts: WorkerOptions;
                                                              statistics?: WorkerStatistics;
                                                              taskAbortFunctions: Map<
                                                                  `${string}-${string}-${string}-${string}-${string}`,
                                                                  () => void,
                                                              >;
                                                              taskFunctions: Map<string, TaskFunctionObject<Data, Response>>;
                                                              addTaskFunction(
                                                                  name: string,
                                                                  fn: TaskFunctionObject<Data, Response> | TaskFunction<Data, Response>,
                                                              ): TaskFunctionOperationResult;
                                                              getMainWorker(): MainWorker;
                                                              handleError(
                                                                  error: Error,
                                                              ): { aborted: boolean; error?: Error; message: string; stack?: string };
                                                              handleKillMessage(message: MessageValue<Data>): void;
                                                              handleReadyMessage(message: MessageValue<Data>): void;
                                                              handleTaskFunctionOperationMessage(message: MessageValue<Data>): void;
                                                              hasTaskFunction(name: string): TaskFunctionOperationResult;
                                                              listTaskFunctionsProperties(): TaskFunctionProperties[];
                                                              messageListener(message: MessageValue<Data>): void;
                                                              removeTaskFunction(name: string): TaskFunctionOperationResult;
                                                              run(task: Task<Data>): void;
                                                              runAsync(fn: TaskAsyncFunction<Data, Response>, task: Task<Data>): void;
                                                              runSync(fn: TaskSyncFunction<Data, Response>, task: Task<Data>): void;
                                                              sendTaskFunctionsPropertiesToMainWorker(): void;
                                                              sendToMainWorker(message: MessageValue<Response, Data>): void;
                                                              setDefaultTaskFunction(name: string): TaskFunctionOperationResult;
                                                          }

                                                          Type Parameters

                                                          • MainWorker extends MessagePort | Worker

                                                            Type of main worker.

                                                            +
                                                          • Data = unknown

                                                            Type of data this worker receives from pool's execution. This can only be structured-cloneable data.

                                                            +
                                                          • Response = unknown

                                                            Type of response the worker sends back to the main worker. This can only be structured-cloneable data.

                                                            +

                                                          Hierarchy (View Summary)

                                                          Index

                                                          Properties

                                                          activeInterval?: Timeout

                                                          Handler id of the activeInterval worker activity check.

                                                          -
                                                          id: number

                                                          Worker id.

                                                          -
                                                          isMain: undefined | boolean

                                                          Whether this is the main worker or not.

                                                          -
                                                          lastTaskTimestamp: number

                                                          Timestamp of the last task processed by this worker.

                                                          -
                                                          opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

                                                          Options for the worker.

                                                          -
                                                          statistics?: WorkerStatistics

                                                          Performance statistics computation requirements.

                                                          -
                                                          taskAbortFunctions: Map<
                                                              `${string}-${string}-${string}-${string}-${string}`,
                                                              () => void,
                                                          >

                                                          Task abort functions processed by the worker when task operation 'abort' is received.

                                                          -
                                                          taskFunctions: Map<string, TaskFunctionObject<Data, Response>>

                                                          Task function object(s) processed by the worker when the pool's execute method is invoked.

                                                          -

                                                          Methods

                                                          id: number

                                                          Worker id.

                                                          +
                                                          isMain: boolean | undefined

                                                          Whether this is the main worker or not.

                                                          +
                                                          lastTaskTimestamp: number

                                                          Timestamp of the last task processed by this worker.

                                                          +
                                                          opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

                                                          Options for the worker.

                                                          +
                                                          statistics?: WorkerStatistics

                                                          Performance statistics computation requirements.

                                                          +
                                                          taskAbortFunctions: Map<
                                                              `${string}-${string}-${string}-${string}-${string}`,
                                                              () => void,
                                                          >

                                                          Task abort functions processed by the worker when task operation 'abort' is received.

                                                          +
                                                          taskFunctions: Map<string, TaskFunctionObject<Data, Response>>

                                                          Task function object(s) processed by the worker when the pool's execute method is invoked.

                                                          +

                                                          Methods

                                                          Returns TaskFunctionOperationResult

                                                          Whether the task function was added or not.

                                                          +
                                                          • Handles a worker error.

                                                            +

                                                            If the main worker is not set.

                                                            +
                                                          • Handles a worker error.

                                                            Parameters

                                                            • error: Error

                                                              The error raised by the worker.

                                                              -

                                                            Returns { aborted: boolean; error?: Error; message: string; stack?: string }

                                                            The worker error object.

                                                            -
                                                          • Handles a kill message sent by the main worker.

                                                            +

                                                          Returns { aborted: boolean; error?: Error; message: string; stack?: string }

                                                          The worker error object.

                                                          +
                                                          • Handles the ready message sent by the main worker.

                                                            +

                                                          Returns void

                                                          Returns void

                                                          Returns TaskFunctionOperationResult

                                                          Whether the worker has a task function with the given name or not.

                                                          +

                                                          Returns void

                                                          • Runs the given task.

                                                            +

                                                          Returns TaskFunctionOperationResult

                                                          Whether the task function existed and was removed or not.

                                                          +

                                                          Returns void

                                                          Returns void

                                                          Returns void

                                                          Returns void

                                                          +

                                                          Returns TaskFunctionOperationResult

                                                          Whether the default task function was set or not.

                                                          +
                                                          diff --git a/docs/interfaces/src.CircularBuffer.html b/docs/interfaces/src.CircularBuffer.html index 4e9120856..de561ecd8 100644 --- a/docs/interfaces/src.CircularBuffer.html +++ b/docs/interfaces/src.CircularBuffer.html @@ -1,20 +1,20 @@ -CircularBuffer | poolifier - v5.1.6
                                                          poolifier - v5.1.6
                                                            Preparing search index...

                                                            Interface CircularBufferInternal

                                                            Circular buffer designed for numbers.

                                                            -
                                                            interface CircularBuffer {
                                                                size: number;
                                                                clear(): void;
                                                                empty(): boolean;
                                                                full(): boolean;
                                                                get(): undefined | number;
                                                                put(number: number): void;
                                                                toArray(): number[];
                                                            }
                                                            Index

                                                            Properties

                                                            size +CircularBuffer | poolifier - v5.1.7
                                                            poolifier - v5.1.7
                                                              Preparing search index...

                                                              Interface CircularBufferInternal

                                                              Circular buffer designed for numbers.

                                                              +
                                                              interface CircularBuffer {
                                                                  size: number;
                                                                  clear(): void;
                                                                  empty(): boolean;
                                                                  full(): boolean;
                                                                  get(): number | undefined;
                                                                  put(number: number): void;
                                                                  toArray(): number[];
                                                              }
                                                              Index

                                                              Properties

                                                              Methods

                                                              Properties

                                                              size: number

                                                              Methods

                                                              • Checks whether the buffer is empty.

                                                                +

                                                              Properties

                                                              size: number

                                                              Methods

                                                              • Checks whether the buffer is empty.

                                                                Returns boolean

                                                                Whether the buffer is empty.

                                                                -
                                                              • Checks whether the buffer is full.

                                                                Returns boolean

                                                                Whether the buffer is full.

                                                                -
                                                              • Gets number from buffer.

                                                                -

                                                                Returns undefined | number

                                                                Number from buffer.

                                                                -
                                                              • Gets number from buffer.

                                                                +

                                                                Returns number | undefined

                                                                Number from buffer.

                                                                +
                                                              • Puts number into buffer.

                                                                Parameters

                                                                • number: number

                                                                  Number to put into buffer.

                                                                  -

                                                                Returns void

                                                              • Returns buffer as numbers' array.

                                                                +

                                                              Returns void

                                                              +
                                                              diff --git a/docs/interfaces/src.EventLoopUtilizationMeasurementStatistics.html b/docs/interfaces/src.EventLoopUtilizationMeasurementStatistics.html index bd827a09e..df3756a11 100644 --- a/docs/interfaces/src.EventLoopUtilizationMeasurementStatistics.html +++ b/docs/interfaces/src.EventLoopUtilizationMeasurementStatistics.html @@ -1,6 +1,6 @@ -EventLoopUtilizationMeasurementStatistics | poolifier - v5.1.6
                                                              poolifier - v5.1.6
                                                                Preparing search index...

                                                                Interface EventLoopUtilizationMeasurementStatisticsInternal

                                                                Event loop utilization measurement statistics.

                                                                -
                                                                interface EventLoopUtilizationMeasurementStatistics {
                                                                    active: MeasurementStatistics;
                                                                    count?: number;
                                                                    idle: MeasurementStatistics;
                                                                    utilization?: number;
                                                                }
                                                                Index

                                                                Properties

                                                                active +EventLoopUtilizationMeasurementStatistics | poolifier - v5.1.7
                                                                poolifier - v5.1.7
                                                                  Preparing search index...

                                                                  Interface EventLoopUtilizationMeasurementStatisticsInternal

                                                                  Event loop utilization measurement statistics.

                                                                  +
                                                                  interface EventLoopUtilizationMeasurementStatistics {
                                                                      active: MeasurementStatistics;
                                                                      count?: number;
                                                                      idle: MeasurementStatistics;
                                                                      utilization?: number;
                                                                  }
                                                                  Index

                                                                  Properties

                                                                  count?: number
                                                                  utilization?: number
                                                                  +

                                                                  Properties

                                                                  count?: number
                                                                  utilization?: number
                                                                  diff --git a/docs/interfaces/src.FixedQueueNode.html b/docs/interfaces/src.FixedQueueNode.html index f6575a99c..00c59a17a 100644 --- a/docs/interfaces/src.FixedQueueNode.html +++ b/docs/interfaces/src.FixedQueueNode.html @@ -1,6 +1,6 @@ -FixedQueueNode | poolifier - v5.1.6
                                                                  poolifier - v5.1.6
                                                                    Preparing search index...

                                                                    Interface FixedQueueNode<T>Internal

                                                                    Fixed queue node.

                                                                    -
                                                                    interface FixedQueueNode<T> {
                                                                        data: T;
                                                                        priority: number;
                                                                        timestamp: number;
                                                                    }

                                                                    Type Parameters

                                                                    • T

                                                                      Type of fixed queue node data.

                                                                      -
                                                                    Index

                                                                    Properties

                                                                    data +FixedQueueNode | poolifier - v5.1.7
                                                                    poolifier - v5.1.7
                                                                      Preparing search index...

                                                                      Interface FixedQueueNode<T>Internal

                                                                      Fixed queue node.

                                                                      +
                                                                      interface FixedQueueNode<T> {
                                                                          data: T;
                                                                          priority: number;
                                                                          timestamp: number;
                                                                      }

                                                                      Type Parameters

                                                                      • T

                                                                        Type of fixed queue node data.

                                                                        +
                                                                      Index

                                                                      Properties

                                                                      Properties

                                                                      data: T
                                                                      priority: number
                                                                      timestamp: number
                                                                      +

                                                                      Properties

                                                                      data: T
                                                                      priority: number
                                                                      timestamp: number
                                                                      diff --git a/docs/interfaces/src.IFixedQueue.html b/docs/interfaces/src.IFixedQueue.html index b1e95989a..d3f43a6cf 100644 --- a/docs/interfaces/src.IFixedQueue.html +++ b/docs/interfaces/src.IFixedQueue.html @@ -1,6 +1,6 @@ -IFixedQueue | poolifier - v5.1.6
                                                                      poolifier - v5.1.6
                                                                        Preparing search index...

                                                                        Interface IFixedQueue<T>Internal

                                                                        Fixed queue.

                                                                        -
                                                                        interface IFixedQueue<T> {
                                                                            "[iterator]": () => Iterator<T>;
                                                                            capacity: number;
                                                                            clear: () => void;
                                                                            delete: (data: T) => boolean;
                                                                            dequeue: () => undefined | T;
                                                                            empty: () => boolean;
                                                                            enqueue: (data: T, priority?: number) => number;
                                                                            full: () => boolean;
                                                                            get: (index: number) => undefined | T;
                                                                            nodeArray: (undefined | FixedQueueNode<T>)[];
                                                                            size: number;
                                                                        }

                                                                        Type Parameters

                                                                        • T

                                                                          Type of fixed queue data.

                                                                          -
                                                                        Index

                                                                        Properties

                                                                        [iterator] +IFixedQueue | poolifier - v5.1.7
                                                                        poolifier - v5.1.7
                                                                          Preparing search index...

                                                                          Interface IFixedQueue<T>Internal

                                                                          Fixed queue.

                                                                          +
                                                                          interface IFixedQueue<T> {
                                                                              "[iterator]": () => Iterator<T>;
                                                                              capacity: number;
                                                                              clear: () => void;
                                                                              delete: (data: T) => boolean;
                                                                              dequeue: () => T | undefined;
                                                                              empty: () => boolean;
                                                                              enqueue: (data: T, priority?: number) => number;
                                                                              full: () => boolean;
                                                                              get: (index: number) => T | undefined;
                                                                              nodeArray: (FixedQueueNode<T> | undefined)[];
                                                                              size: number;
                                                                          }

                                                                          Type Parameters

                                                                          • T

                                                                            Type of fixed queue data.

                                                                            +
                                                                          Index

                                                                          Properties

                                                                          [iterator] capacity clear delete @@ -13,26 +13,26 @@ size

                                                                          Properties

                                                                          "[iterator]": () => Iterator<T>

                                                                          Returns an iterator for the fixed queue.

                                                                          Type Declaration

                                                                            • (): Iterator<T>
                                                                            • Returns Iterator<T>

                                                                              An iterator for the fixed queue.

                                                                              -
                                                                          capacity: number

                                                                          The fixed queue capacity.

                                                                          -
                                                                          clear: () => void

                                                                          Clears the fixed queue.

                                                                          -
                                                                          delete: (data: T) => boolean

                                                                          Deletes the given data from the fixed priority queue.

                                                                          +
                                                                          capacity: number

                                                                          The fixed queue capacity.

                                                                          +
                                                                          clear: () => void

                                                                          Clears the fixed queue.

                                                                          +
                                                                          delete: (data: T) => boolean

                                                                          Deletes the given data from the fixed priority queue.

                                                                          Type Declaration

                                                                            • (data: T): boolean
                                                                            • Parameters

                                                                              • data: T

                                                                                Data to delete.

                                                                                -

                                                                              Returns boolean

                                                                              true if the data was deleted, false otherwise.

                                                                              -
                                                                          dequeue: () => undefined | T

                                                                          Dequeue data from the fixed queue.

                                                                          -

                                                                          Type Declaration

                                                                            • (): undefined | T
                                                                            • Returns undefined | T

                                                                              The dequeued data or undefined if the fixed queue is empty.

                                                                              -
                                                                          empty: () => boolean

                                                                          Checks if the fixed queue is empty.

                                                                          +

                                                                          Returns boolean

                                                                          true if the data was deleted, false otherwise.

                                                                          +
                                                                          dequeue: () => T | undefined

                                                                          Dequeue data from the fixed queue.

                                                                          +

                                                                          Type Declaration

                                                                            • (): T | undefined
                                                                            • Returns T | undefined

                                                                              The dequeued data or undefined if the fixed queue is empty.

                                                                              +
                                                                          empty: () => boolean

                                                                          Checks if the fixed queue is empty.

                                                                          Type Declaration

                                                                            • (): boolean
                                                                            • Returns boolean

                                                                              true if the fixed queue is empty, false otherwise.

                                                                              -
                                                                          enqueue: (data: T, priority?: number) => number

                                                                          Enqueue data into the fixed queue.

                                                                          +
                                                                          enqueue: (data: T, priority?: number) => number

                                                                          Enqueue data into the fixed queue.

                                                                          Type Declaration

                                                                            • (data: T, priority?: number): number
                                                                            • Parameters

                                                                              • data: T

                                                                                Data to enqueue.

                                                                                -
                                                                              • Optionalpriority: number

                                                                                Priority of the data. Lower values have higher priority.

                                                                                -

                                                                              Returns number

                                                                              The new size of the fixed queue.

                                                                              -

                                                                          If the fixed queue is full.

                                                                          -
                                                                          full: () => boolean

                                                                          Checks if the fixed queue is full.

                                                                          +
                                                                        • Optionalpriority: number

                                                                          Priority of the data. Lower values have higher priority.

                                                                          +
                                                                        • Returns number

                                                                          The new size of the fixed queue.

                                                                          +

                                                                          If the fixed queue is full.

                                                                          +
                                                                          full: () => boolean

                                                                          Checks if the fixed queue is full.

                                                                          Type Declaration

                                                                            • (): boolean
                                                                            • Returns boolean

                                                                              true if the fixed queue is full, false otherwise.

                                                                              -
                                                                          get: (index: number) => undefined | T

                                                                          Gets data from the fixed queue.

                                                                          -

                                                                          Type Declaration

                                                                            • (index: number): undefined | T
                                                                            • Parameters

                                                                              • index: number

                                                                                The index of the data to get.

                                                                                -

                                                                              Returns undefined | T

                                                                              The data at the index or undefined if the fixed queue is empty or the index is out of bounds.

                                                                              -
                                                                          nodeArray: (undefined | FixedQueueNode<T>)[]

                                                                          The fixed queue node array.

                                                                          -
                                                                          size: number

                                                                          The fixed queue size.

                                                                          -
                                                                          +
                                                                          get: (index: number) => T | undefined

                                                                          Gets data from the fixed queue.

                                                                          +

                                                                          Type Declaration

                                                                            • (index: number): T | undefined
                                                                            • Parameters

                                                                              • index: number

                                                                                The index of the data to get.

                                                                                +

                                                                              Returns T | undefined

                                                                              The data at the index or undefined if the fixed queue is empty or the index is out of bounds.

                                                                              +
                                                                          nodeArray: (FixedQueueNode<T> | undefined)[]

                                                                          The fixed queue node array.

                                                                          +
                                                                          size: number

                                                                          The fixed queue size.

                                                                          +
                                                                          diff --git a/docs/interfaces/src.IPool.html b/docs/interfaces/src.IPool.html index 8de8b3cc2..9a1211fa7 100644 --- a/docs/interfaces/src.IPool.html +++ b/docs/interfaces/src.IPool.html @@ -1,8 +1,8 @@ -IPool | poolifier - v5.1.6
                                                                          poolifier - v5.1.6
                                                                            Preparing search index...

                                                                            Interface IPool<Worker, Data, Response>

                                                                            Contract definition for a poolifier pool.

                                                                            -
                                                                            interface IPool<Worker extends IWorker, Data = unknown, Response = unknown> {
                                                                                addTaskFunction: (
                                                                                    name: string,
                                                                                    fn: TaskFunction<Data, Response> | TaskFunctionObject<Data, Response>,
                                                                                ) => Promise<boolean>;
                                                                                destroy: () => Promise<void>;
                                                                                emitter?: EventEmitterAsyncResource;
                                                                                enableTasksQueue: (
                                                                                    enable: boolean,
                                                                                    tasksQueueOptions?: TasksQueueOptions,
                                                                                ) => void;
                                                                                execute: (
                                                                                    data?: Data,
                                                                                    name?: string,
                                                                                    abortSignal?: AbortSignal,
                                                                                    transferList?: readonly Transferable[],
                                                                                ) => Promise<Response>;
                                                                                hasTaskFunction: (name: string) => boolean;
                                                                                info: PoolInfo;
                                                                                listTaskFunctionsProperties: () => TaskFunctionProperties[];
                                                                                mapExecute: (
                                                                                    data: Iterable<Data>,
                                                                                    name?: string,
                                                                                    abortSignals?: Iterable<AbortSignal, any, any>,
                                                                                    transferList?: readonly Transferable[],
                                                                                ) => Promise<Response[]>;
                                                                                removeTaskFunction: (name: string) => Promise<boolean>;
                                                                                setDefaultTaskFunction: (name: string) => Promise<boolean>;
                                                                                setTasksQueueOptions: (tasksQueueOptions: TasksQueueOptions) => void;
                                                                                setWorkerChoiceStrategy: (
                                                                                    workerChoiceStrategy:
                                                                                        | "FAIR_SHARE"
                                                                                        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                        | "LEAST_BUSY"
                                                                                        | "LEAST_ELU"
                                                                                        | "LEAST_USED"
                                                                                        | "ROUND_ROBIN"
                                                                                        | "WEIGHTED_ROUND_ROBIN",
                                                                                    workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions,
                                                                                ) => void;
                                                                                setWorkerChoiceStrategyOptions: (
                                                                                    workerChoiceStrategyOptions: WorkerChoiceStrategyOptions,
                                                                                ) => boolean;
                                                                                start: () => void;
                                                                                workerNodes: IWorkerNode<Worker, Data>[];
                                                                            }

                                                                            Type Parameters

                                                                            • Worker extends IWorker

                                                                              Type of worker which manages this pool.

                                                                              -
                                                                            • Data = unknown

                                                                              Type of data sent to the worker. This can only be structured-cloneable data.

                                                                              -
                                                                            • Response = unknown

                                                                              Type of execution response. This can only be structured-cloneable data.

                                                                              -

                                                                            Implemented by

                                                                            Index

                                                                            Properties

                                                                            addTaskFunction +IPool | poolifier - v5.1.7
                                                                            poolifier - v5.1.7
                                                                              Preparing search index...

                                                                              Interface IPool<Worker, Data, Response>

                                                                              Contract definition for a poolifier pool.

                                                                              +
                                                                              interface IPool<Worker extends IWorker, Data = unknown, Response = unknown> {
                                                                                  addTaskFunction: (
                                                                                      name: string,
                                                                                      fn: TaskFunction<Data, Response> | TaskFunctionObject<Data, Response>,
                                                                                  ) => Promise<boolean>;
                                                                                  destroy: () => Promise<void>;
                                                                                  emitter?: EventEmitterAsyncResource;
                                                                                  enableTasksQueue: (
                                                                                      enable: boolean,
                                                                                      tasksQueueOptions?: TasksQueueOptions,
                                                                                  ) => void;
                                                                                  execute: (
                                                                                      data?: Data,
                                                                                      name?: string,
                                                                                      abortSignal?: AbortSignal,
                                                                                      transferList?: readonly Transferable[],
                                                                                  ) => Promise<Response>;
                                                                                  hasTaskFunction: (name: string) => boolean;
                                                                                  info: PoolInfo;
                                                                                  listTaskFunctionsProperties: () => TaskFunctionProperties[];
                                                                                  mapExecute: (
                                                                                      data: Iterable<Data>,
                                                                                      name?: string,
                                                                                      abortSignals?: Iterable<AbortSignal, any, any>,
                                                                                      transferList?: readonly Transferable[],
                                                                                  ) => Promise<Response[]>;
                                                                                  removeTaskFunction: (name: string) => Promise<boolean>;
                                                                                  setDefaultTaskFunction: (name: string) => Promise<boolean>;
                                                                                  setTasksQueueOptions: (tasksQueueOptions: TasksQueueOptions) => void;
                                                                                  setWorkerChoiceStrategy: (
                                                                                      workerChoiceStrategy:
                                                                                          | "FAIR_SHARE"
                                                                                          | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                          | "LEAST_BUSY"
                                                                                          | "LEAST_ELU"
                                                                                          | "LEAST_USED"
                                                                                          | "ROUND_ROBIN"
                                                                                          | "WEIGHTED_ROUND_ROBIN",
                                                                                      workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions,
                                                                                  ) => void;
                                                                                  setWorkerChoiceStrategyOptions: (
                                                                                      workerChoiceStrategyOptions: WorkerChoiceStrategyOptions,
                                                                                  ) => boolean;
                                                                                  start: () => void;
                                                                                  workerNodes: IWorkerNode<Worker, Data>[];
                                                                              }

                                                                              Type Parameters

                                                                              • Worker extends IWorker

                                                                                Type of worker which manages this pool.

                                                                                +
                                                                              • Data = unknown

                                                                                Type of data sent to the worker. This can only be structured-cloneable data.

                                                                                +
                                                                              • Response = unknown

                                                                                Type of execution response. This can only be structured-cloneable data.

                                                                                +

                                                                              Implemented by

                                                                              Index

                                                                              Properties

                                                                              Properties

                                                                              addTaskFunction: (
                                                                                  name: string,
                                                                                  fn: TaskFunction<Data, Response> | TaskFunctionObject<Data, Response>,
                                                                              ) => Promise<boolean>

                                                                              Adds a task function to this pool. If a task function with the same name already exists, it will be overwritten.

                                                                              Type Declaration

                                                                              https://nodejs.org/api/errors.html#class-typeerror If the name parameter is not a string or an empty string.

                                                                              -

                                                                              https://nodejs.org/api/errors.html#class-typeerror If the fn parameter is not a function or task function object.

                                                                              -
                                                                              destroy: () => Promise<void>

                                                                              Terminates all workers in this pool.

                                                                              -
                                                                              emitter?: EventEmitterAsyncResource

                                                                              Pool event emitter integrated with async resource. +

                                                                            • fn: TaskFunction<Data, Response> | TaskFunctionObject<Data, Response>

                                                                              The task function.

                                                                              +
                                                                            • Returns Promise<boolean>

                                                                              true if the task function was added, false otherwise.

                                                                              +

                                                                              If the name parameter is not a string or an empty string.

                                                                              +

                                                                              If the fn parameter is not a function or task function object.

                                                                              +
                                                                              destroy: () => Promise<void>

                                                                              Terminates all workers in this pool.

                                                                              +
                                                                              emitter?: EventEmitterAsyncResource

                                                                              Pool event emitter integrated with async resource. The async tracking tooling identifier is poolifier:<PoolType>-<WorkerType>-pool.

                                                                              Events that can currently be listened to:

                                                                                @@ -42,41 +42,41 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
                                                                              • 'backPressure': Emitted when the number of workers created in the pool has reached the maximum size expected and are back pressured (i.e. their tasks queue is full: queue size >= maximum queue size).
                                                                              • 'backPressureEnd': Emitted when the number of workers created in the pool has reached the maximum size expected and are no longer back pressured (i.e. their tasks queue is no longer full: queue size < maximum queue size).
                                                                              -
                                                                              enableTasksQueue: (
                                                                                  enable: boolean,
                                                                                  tasksQueueOptions?: TasksQueueOptions,
                                                                              ) => void

                                                                              Enables/disables the worker node tasks queue in this pool.

                                                                              +
                                                                              enableTasksQueue: (
                                                                                  enable: boolean,
                                                                                  tasksQueueOptions?: TasksQueueOptions,
                                                                              ) => void

                                                                              Enables/disables the worker node tasks queue in this pool.

                                                                              Type Declaration

                                                                                • (enable: boolean, tasksQueueOptions?: TasksQueueOptions): void
                                                                                • Parameters

                                                                                  • enable: boolean

                                                                                    Whether to enable or disable the worker node tasks queue.

                                                                                    -
                                                                                  • OptionaltasksQueueOptions: TasksQueueOptions

                                                                                    The worker node tasks queue options.

                                                                                    -

                                                                                  Returns void

                                                                              execute: (
                                                                                  data?: Data,
                                                                                  name?: string,
                                                                                  abortSignal?: AbortSignal,
                                                                                  transferList?: readonly Transferable[],
                                                                              ) => Promise<Response>

                                                                              Executes the specified function in the worker constructor with the task data input parameter.

                                                                              +
                                                                            • OptionaltasksQueueOptions: TasksQueueOptions

                                                                              The worker node tasks queue options.

                                                                              +
                                                                            • Returns void

                                                                              execute: (
                                                                                  data?: Data,
                                                                                  name?: string,
                                                                                  abortSignal?: AbortSignal,
                                                                                  transferList?: readonly Transferable[],
                                                                              ) => Promise<Response>

                                                                              Executes the specified function in the worker constructor with the task data input parameter.

                                                                              Type Declaration

                                                                                • (
                                                                                      data?: Data,
                                                                                      name?: string,
                                                                                      abortSignal?: AbortSignal,
                                                                                      transferList?: readonly Transferable[],
                                                                                  ): Promise<Response>
                                                                                • Parameters

                                                                                  • Optionaldata: Data

                                                                                    The optional task input data for the specified task function. This can only be structured-cloneable data.

                                                                                    -
                                                                                  • Optionalname: string

                                                                                    The optional name of the task function to execute. If not specified, the default task function will be executed.

                                                                                    -
                                                                                  • OptionalabortSignal: AbortSignal

                                                                                    The optional AbortSignal to abort the task.

                                                                                    -
                                                                                  • OptionaltransferList: readonly Transferable[]

                                                                                    The optional array of transferable objects to transfer ownership of. Ownership of the transferred objects is given to the chosen pool's worker_threads worker and they should not be used in the main thread afterwards.

                                                                                    -

                                                                                  Returns Promise<Response>

                                                                                  Promise with a task function response that will be fulfilled when the task is completed.

                                                                                  -
                                                                              hasTaskFunction: (name: string) => boolean

                                                                              Whether the specified task function exists in this pool.

                                                                              +
                                                                            • Optionalname: string

                                                                              The optional name of the task function to execute. If not specified, the default task function will be executed.

                                                                              +
                                                                            • OptionalabortSignal: AbortSignal

                                                                              The optional AbortSignal to abort the task.

                                                                              +
                                                                            • OptionaltransferList: readonly Transferable[]

                                                                              The optional array of transferable objects to transfer ownership of. Ownership of the transferred objects is given to the chosen pool's worker_threads worker and they should not be used in the main thread afterwards.

                                                                              +
                                                                            • Returns Promise<Response>

                                                                              Promise with a task function response that will be fulfilled when the task is completed.

                                                                              +
                                                                              hasTaskFunction: (name: string) => boolean

                                                                              Whether the specified task function exists in this pool.

                                                                              Type Declaration

                                                                                • (name: string): boolean
                                                                                • Parameters

                                                                                  • name: string

                                                                                    The name of the task function.

                                                                                    -

                                                                                  Returns boolean

                                                                                  true if the task function exists, false otherwise.

                                                                                  -
                                                                              info: PoolInfo

                                                                              Pool information.

                                                                              -
                                                                              listTaskFunctionsProperties: () => TaskFunctionProperties[]

                                                                              Lists the properties of task functions available in this pool.

                                                                              +

                                                                              Returns boolean

                                                                              true if the task function exists, false otherwise.

                                                                              +
                                                                              info: PoolInfo

                                                                              Pool information.

                                                                              +
                                                                              listTaskFunctionsProperties: () => TaskFunctionProperties[]

                                                                              Lists the properties of task functions available in this pool.

                                                                              Type Declaration

                                                                              mapExecute: (
                                                                                  data: Iterable<Data>,
                                                                                  name?: string,
                                                                                  abortSignals?: Iterable<AbortSignal, any, any>,
                                                                                  transferList?: readonly Transferable[],
                                                                              ) => Promise<Response[]>

                                                                              Executes the specified function in the worker constructor with the tasks data iterable input parameter.

                                                                              +
                                                                              mapExecute: (
                                                                                  data: Iterable<Data>,
                                                                                  name?: string,
                                                                                  abortSignals?: Iterable<AbortSignal, any, any>,
                                                                                  transferList?: readonly Transferable[],
                                                                              ) => Promise<Response[]>

                                                                              Executes the specified function in the worker constructor with the tasks data iterable input parameter.

                                                                              Type Declaration

                                                                                • (
                                                                                      data: Iterable<Data>,
                                                                                      name?: string,
                                                                                      abortSignals?: Iterable<AbortSignal, any, any>,
                                                                                      transferList?: readonly Transferable[],
                                                                                  ): Promise<Response[]>
                                                                                • Parameters

                                                                                  • data: Iterable<Data>

                                                                                    The tasks iterable input data for the specified task function. This can only be an iterable of structured-cloneable data.

                                                                                    -
                                                                                  • Optionalname: string

                                                                                    The optional name of the task function to execute. If not specified, the default task function will be executed.

                                                                                    -
                                                                                  • OptionalabortSignals: Iterable<AbortSignal, any, any>

                                                                                    The optional iterable of AbortSignal to abort the tasks iterable.

                                                                                    -
                                                                                  • OptionaltransferList: readonly Transferable[]

                                                                                    The optional array of transferable objects to transfer ownership of. Ownership of the transferred objects is given to the chosen pool's worker_threads worker and they should not be used in the main thread afterwards.

                                                                                    -

                                                                                  Returns Promise<Response[]>

                                                                                  Promise with an array of task function responses that will be fulfilled when the tasks are completed.

                                                                                  -
                                                                              removeTaskFunction: (name: string) => Promise<boolean>

                                                                              Removes a task function from this pool.

                                                                              +
                                                                            • Optionalname: string

                                                                              The optional name of the task function to execute. If not specified, the default task function will be executed.

                                                                              +
                                                                            • OptionalabortSignals: Iterable<AbortSignal, any, any>

                                                                              The optional iterable of AbortSignal to abort the tasks iterable.

                                                                              +
                                                                            • OptionaltransferList: readonly Transferable[]

                                                                              The optional array of transferable objects to transfer ownership of. Ownership of the transferred objects is given to the chosen pool's worker_threads worker and they should not be used in the main thread afterwards.

                                                                              +
                                                                            • Returns Promise<Response[]>

                                                                              Promise with an array of task function responses that will be fulfilled when the tasks are completed.

                                                                              +
                                                                              removeTaskFunction: (name: string) => Promise<boolean>

                                                                              Removes a task function from this pool.

                                                                              Type Declaration

                                                                                • (name: string): Promise<boolean>
                                                                                • Parameters

                                                                                  • name: string

                                                                                    The name of the task function.

                                                                                    -

                                                                                  Returns Promise<boolean>

                                                                                  true if the task function was removed, false otherwise.

                                                                                  -
                                                                              setDefaultTaskFunction: (name: string) => Promise<boolean>

                                                                              Sets the default task function in this pool.

                                                                              +

                                                                              Returns Promise<boolean>

                                                                              true if the task function was removed, false otherwise.

                                                                              +
                                                                              setDefaultTaskFunction: (name: string) => Promise<boolean>

                                                                              Sets the default task function in this pool.

                                                                              Type Declaration

                                                                                • (name: string): Promise<boolean>
                                                                                • Parameters

                                                                                  • name: string

                                                                                    The name of the task function.

                                                                                    -

                                                                                  Returns Promise<boolean>

                                                                                  true if the default task function was set, false otherwise.

                                                                                  -
                                                                              setTasksQueueOptions: (tasksQueueOptions: TasksQueueOptions) => void

                                                                              Sets the worker node tasks queue options in this pool.

                                                                              +

                                                                              Returns Promise<boolean>

                                                                              true if the default task function was set, false otherwise.

                                                                              +
                                                                              setTasksQueueOptions: (tasksQueueOptions: TasksQueueOptions) => void

                                                                              Sets the worker node tasks queue options in this pool.

                                                                              Type Declaration

                                                                              setWorkerChoiceStrategy: (
                                                                                  workerChoiceStrategy:
                                                                                      | "FAIR_SHARE"
                                                                                      | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                      | "LEAST_BUSY"
                                                                                      | "LEAST_ELU"
                                                                                      | "LEAST_USED"
                                                                                      | "ROUND_ROBIN"
                                                                                      | "WEIGHTED_ROUND_ROBIN",
                                                                                  workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions,
                                                                              ) => void

                                                                              Sets the default worker choice strategy in this pool.

                                                                              +

                                                                              Returns void

                                                                              setWorkerChoiceStrategy: (
                                                                                  workerChoiceStrategy:
                                                                                      | "FAIR_SHARE"
                                                                                      | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                      | "LEAST_BUSY"
                                                                                      | "LEAST_ELU"
                                                                                      | "LEAST_USED"
                                                                                      | "ROUND_ROBIN"
                                                                                      | "WEIGHTED_ROUND_ROBIN",
                                                                                  workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions,
                                                                              ) => void

                                                                              Sets the default worker choice strategy in this pool.

                                                                              Type Declaration

                                                                                • (
                                                                                      workerChoiceStrategy:
                                                                                          | "FAIR_SHARE"
                                                                                          | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                          | "LEAST_BUSY"
                                                                                          | "LEAST_ELU"
                                                                                          | "LEAST_USED"
                                                                                          | "ROUND_ROBIN"
                                                                                          | "WEIGHTED_ROUND_ROBIN",
                                                                                      workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions,
                                                                                  ): void
                                                                                • Parameters

                                                                                  • workerChoiceStrategy:
                                                                                        | "FAIR_SHARE"
                                                                                        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                        | "LEAST_BUSY"
                                                                                        | "LEAST_ELU"
                                                                                        | "LEAST_USED"
                                                                                        | "ROUND_ROBIN"
                                                                                        | "WEIGHTED_ROUND_ROBIN"

                                                                                    The default worker choice strategy.

                                                                                    -
                                                                                  • OptionalworkerChoiceStrategyOptions: WorkerChoiceStrategyOptions

                                                                                    The worker choice strategy options.

                                                                                    -

                                                                                  Returns void

                                                                              setWorkerChoiceStrategyOptions: (
                                                                                  workerChoiceStrategyOptions: WorkerChoiceStrategyOptions,
                                                                              ) => boolean

                                                                              Sets the worker choice strategy options in this pool.

                                                                              +
                                                                            • OptionalworkerChoiceStrategyOptions: WorkerChoiceStrategyOptions

                                                                              The worker choice strategy options.

                                                                              +
                                                                            • Returns void

                                                                              setWorkerChoiceStrategyOptions: (
                                                                                  workerChoiceStrategyOptions: WorkerChoiceStrategyOptions,
                                                                              ) => boolean

                                                                              Sets the worker choice strategy options in this pool.

                                                                              Type Declaration

                                                                              start: () => void

                                                                              Starts the minimum number of workers in this pool.

                                                                              -
                                                                              workerNodes: IWorkerNode<Worker, Data>[]

                                                                              Pool worker nodes.

                                                                              -
                                                                              +

                                                                              Returns boolean

                                                                              true if the worker choice strategy options were set, false otherwise.

                                                                              +
                                                                              start: () => void

                                                                              Starts the minimum number of workers in this pool.

                                                                              +
                                                                              workerNodes: IWorkerNode<Worker, Data>[]

                                                                              Pool worker nodes.

                                                                              +
                                                                              diff --git a/docs/interfaces/src.IWorker.html b/docs/interfaces/src.IWorker.html index 05e08ee21..f41b74fa9 100644 --- a/docs/interfaces/src.IWorker.html +++ b/docs/interfaces/src.IWorker.html @@ -1,5 +1,5 @@ -IWorker | poolifier - v5.1.6
                                                                              poolifier - v5.1.6
                                                                                Preparing search index...

                                                                                Interface IWorker

                                                                                Worker interface.

                                                                                -
                                                                                interface IWorker {
                                                                                    disconnect?: () => void;
                                                                                    id?: number;
                                                                                    kill?: (signal?: string) => void;
                                                                                    on: (event: string, handler: EventHandler<IWorker>) => this;
                                                                                    once: (event: string, handler: EventHandler<IWorker>) => this;
                                                                                    terminate?: () => Promise<number>;
                                                                                    threadId?: number;
                                                                                    unref?: () => void;
                                                                                    "[captureRejectionSymbol]"?<K>(
                                                                                        error: Error,
                                                                                        event: string | symbol,
                                                                                        ...args: AnyRest,
                                                                                    ): void;
                                                                                    addListener<K>(
                                                                                        eventName: string | symbol,
                                                                                        listener: (...args: any[]) => void,
                                                                                    ): this;
                                                                                    emit<K>(eventName: string | symbol, ...args: AnyRest): boolean;
                                                                                    eventNames(): (string | symbol)[];
                                                                                    getMaxListeners(): number;
                                                                                    listenerCount<K>(eventName: string | symbol, listener?: Function): number;
                                                                                    listeners<K>(eventName: string | symbol): Function[];
                                                                                    off<K>(
                                                                                        eventName: string | symbol,
                                                                                        listener: (...args: any[]) => void,
                                                                                    ): this;
                                                                                    prependListener<K>(
                                                                                        eventName: string | symbol,
                                                                                        listener: (...args: any[]) => void,
                                                                                    ): this;
                                                                                    prependOnceListener<K>(
                                                                                        eventName: string | symbol,
                                                                                        listener: (...args: any[]) => void,
                                                                                    ): this;
                                                                                    rawListeners<K>(eventName: string | symbol): Function[];
                                                                                    removeAllListeners(eventName?: string | symbol): this;
                                                                                    removeListener<K>(
                                                                                        eventName: string | symbol,
                                                                                        listener: (...args: any[]) => void,
                                                                                    ): this;
                                                                                    setMaxListeners(n: number): this;
                                                                                }

                                                                                Hierarchy

                                                                                • EventEmitter
                                                                                  • IWorker
                                                                                Index

                                                                                Properties

                                                                                disconnect? +IWorker | poolifier - v5.1.7
                                                                                poolifier - v5.1.7
                                                                                  Preparing search index...

                                                                                  Interface IWorker

                                                                                  Worker interface.

                                                                                  +
                                                                                  interface IWorker {
                                                                                      disconnect?: () => void;
                                                                                      id?: number;
                                                                                      kill?: (signal?: string) => void;
                                                                                      on: (event: string, handler: EventHandler<IWorker>) => this;
                                                                                      once: (event: string, handler: EventHandler<IWorker>) => this;
                                                                                      terminate?: () => Promise<number>;
                                                                                      threadId?: number;
                                                                                      unref?: () => void;
                                                                                      "[captureRejectionSymbol]"?<K>(
                                                                                          error: Error,
                                                                                          event: string | symbol,
                                                                                          ...args: AnyRest,
                                                                                      ): void;
                                                                                      addListener<K>(
                                                                                          eventName: string | symbol,
                                                                                          listener: (...args: any[]) => void,
                                                                                      ): this;
                                                                                      emit<K>(eventName: string | symbol, ...args: AnyRest): boolean;
                                                                                      eventNames(): (string | symbol)[];
                                                                                      getMaxListeners(): number;
                                                                                      listenerCount<K>(eventName: string | symbol, listener?: Function): number;
                                                                                      listeners<K>(eventName: string | symbol): Function[];
                                                                                      off<K>(
                                                                                          eventName: string | symbol,
                                                                                          listener: (...args: any[]) => void,
                                                                                      ): this;
                                                                                      prependListener<K>(
                                                                                          eventName: string | symbol,
                                                                                          listener: (...args: any[]) => void,
                                                                                      ): this;
                                                                                      prependOnceListener<K>(
                                                                                          eventName: string | symbol,
                                                                                          listener: (...args: any[]) => void,
                                                                                      ): this;
                                                                                      rawListeners<K>(eventName: string | symbol): Function[];
                                                                                      removeAllListeners(eventName?: string | symbol): this;
                                                                                      removeListener<K>(
                                                                                          eventName: string | symbol,
                                                                                          listener: (...args: any[]) => void,
                                                                                      ): this;
                                                                                      setMaxListeners(n: number): this;
                                                                                  }

                                                                                  Hierarchy

                                                                                  • EventEmitter
                                                                                    • IWorker
                                                                                  Index

                                                                                  Properties

                                                                                  Properties

                                                                                  disconnect?: () => void

                                                                                  Cluster worker disconnect.

                                                                                  -
                                                                                  id?: number

                                                                                  Cluster worker id.

                                                                                  -
                                                                                  kill?: (signal?: string) => void

                                                                                  Cluster worker kill.

                                                                                  -
                                                                                  on: (event: string, handler: EventHandler<IWorker>) => this

                                                                                  Registers an event handler.

                                                                                  +
                                                                                  id?: number

                                                                                  Cluster worker id.

                                                                                  +
                                                                                  kill?: (signal?: string) => void

                                                                                  Cluster worker kill.

                                                                                  +
                                                                                  on: (event: string, handler: EventHandler<IWorker>) => this

                                                                                  Registers an event handler.

                                                                                  Type Declaration

                                                                                  once: (event: string, handler: EventHandler<IWorker>) => this

                                                                                  Registers once an event handler.

                                                                                  +
                                                                                • handler: EventHandler<IWorker>

                                                                                  The event handler.

                                                                                  +
                                                                                • Returns this

                                                                                  once: (event: string, handler: EventHandler<IWorker>) => this

                                                                                  Registers once an event handler.

                                                                                  Type Declaration

                                                                                  terminate?: () => Promise<number>

                                                                                  Stop all JavaScript execution in the worker thread as soon as possible. +

                                                                                • handler: EventHandler<IWorker>

                                                                                  The event handler.

                                                                                  +
                                                                                • Returns this

                                                                                  terminate?: () => Promise<number>

                                                                                  Stop all JavaScript execution in the worker thread as soon as possible. Returns a Promise for the exit code that is fulfilled when the 'exit' event is emitted.

                                                                                  -
                                                                                  threadId?: number

                                                                                  Worker thread worker id.

                                                                                  -
                                                                                  unref?: () => void

                                                                                  Calling unref() on a worker allows the thread to exit if this is the only +

                                                                                  threadId?: number

                                                                                  Worker thread worker id.

                                                                                  +
                                                                                  unref?: () => void

                                                                                  Calling unref() on a worker allows the thread to exit if this is the only active handle in the event system. If the worker is already unref()ed callingunref() again has no effect.

                                                                                  v10.5.0

                                                                                  -

                                                                                  Methods

                                                                                  • Type Parameters

                                                                                    • K

                                                                                    Parameters

                                                                                    • error: Error
                                                                                    • event: string | symbol
                                                                                    • ...args: AnyRest

                                                                                    Returns void

                                                                                  • Alias for emitter.on(eventName, listener).

                                                                                    +

                                                                                  Methods

                                                                                  • Type Parameters

                                                                                    • K

                                                                                    Parameters

                                                                                    • error: Error
                                                                                    • event: string | symbol
                                                                                    • ...args: AnyRest

                                                                                    Returns void

                                                                                  • Alias for emitter.on(eventName, listener).

                                                                                    Type Parameters

                                                                                    • K

                                                                                    Parameters

                                                                                    • eventName: string | symbol
                                                                                    • listener: (...args: any[]) => void

                                                                                    Returns this

                                                                                    v0.1.26

                                                                                    -
                                                                                  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments +

                                                                                  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

                                                                                    Returns true if the event had listeners, false otherwise.

                                                                                    import { EventEmitter } from 'node:events';
                                                                                    const myEmitter = new EventEmitter();

                                                                                    // First listener
                                                                                    myEmitter.on('event', function firstListener() {
                                                                                    console.log('Helloooo! first listener');
                                                                                    });
                                                                                    // Second listener
                                                                                    myEmitter.on('event', function secondListener(arg1, arg2) {
                                                                                    console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
                                                                                    });
                                                                                    // Third listener
                                                                                    myEmitter.on('event', function thirdListener(...args) {
                                                                                    const parameters = args.join(', ');
                                                                                    console.log(`event with parameters ${parameters} in third listener`);
                                                                                    });

                                                                                    console.log(myEmitter.listeners('event'));

                                                                                    myEmitter.emit('event', 1, 2, 3, 4, 5);

                                                                                    // Prints:
                                                                                    // [
                                                                                    // [Function: firstListener],
                                                                                    // [Function: secondListener],
                                                                                    // [Function: thirdListener]
                                                                                    // ]
                                                                                    // Helloooo! first listener
                                                                                    // event with parameters 1, 2 in second listener
                                                                                    // event with parameters 1, 2, 3, 4, 5 in third listener

                                                                                    Type Parameters

                                                                                    • K

                                                                                    Parameters

                                                                                    • eventName: string | symbol
                                                                                    • ...args: AnyRest

                                                                                    Returns boolean

                                                                                    v0.1.26

                                                                                    -
                                                                                  • Returns an array listing the events for which the emitter has registered +

                                                                                  • Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.

                                                                                    import { EventEmitter } from 'node:events';

                                                                                    const myEE = new EventEmitter();
                                                                                    myEE.on('foo', () => {});
                                                                                    myEE.on('bar', () => {});

                                                                                    const sym = Symbol('symbol');
                                                                                    myEE.on(sym, () => {});

                                                                                    console.log(myEE.eventNames());
                                                                                    // Prints: [ 'foo', 'bar', Symbol(symbol) ]

                                                                                    Returns (string | symbol)[]

                                                                                    v6.0.0

                                                                                    -
                                                                                  • Returns the current max listener value for the EventEmitter which is either +

                                                                                  • Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to EventEmitter.defaultMaxListeners.

                                                                                    Returns number

                                                                                    v1.0.0

                                                                                    -
                                                                                  • Returns the number of listeners listening for the event named eventName. +

                                                                                  • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

                                                                                    Type Parameters

                                                                                    • K

                                                                                    Parameters

                                                                                    • eventName: string | symbol

                                                                                      The name of the event being listened for

                                                                                      -
                                                                                    • Optionallistener: Function

                                                                                      The event handler function

                                                                                      -

                                                                                    Returns number

                                                                                    v3.2.0

                                                                                    -
                                                                                  • Returns a copy of the array of listeners for the event named eventName.

                                                                                    +
                                                                                  • Optionallistener: Function

                                                                                    The event handler function

                                                                                    +

                                                                                  Returns number

                                                                                  v3.2.0

                                                                                  +
                                                                                  • Returns a copy of the array of listeners for the event named eventName.

                                                                                    server.on('connection', (stream) => {
                                                                                    console.log('someone connected!');
                                                                                    });
                                                                                    console.log(util.inspect(server.listeners('connection')));
                                                                                    // Prints: [ [Function] ]

                                                                                    Type Parameters

                                                                                    • K

                                                                                    Parameters

                                                                                    • eventName: string | symbol

                                                                                    Returns Function[]

                                                                                    v0.1.26

                                                                                    -
                                                                                  • Alias for emitter.removeListener().

                                                                                    +
                                                                                  • Alias for emitter.removeListener().

                                                                                    Type Parameters

                                                                                    • K

                                                                                    Parameters

                                                                                    • eventName: string | symbol
                                                                                    • listener: (...args: any[]) => void

                                                                                    Returns this

                                                                                    v10.0.0

                                                                                    -
                                                                                  • Adds the listener function to the beginning of the listeners array for the +

                                                                                  • Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.

                                                                                    @@ -76,30 +76,30 @@ and listener will result in the listener being added,

                                                                                    Returns a reference to the EventEmitter, so that calls can be chained.

                                                                                    Type Parameters

                                                                                    • K

                                                                                    Parameters

                                                                                    • eventName: string | symbol

                                                                                      The name of the event.

                                                                                      -
                                                                                    • listener: (...args: any[]) => void

                                                                                      The callback function

                                                                                      -

                                                                                    Returns this

                                                                                    v6.0.0

                                                                                    -
                                                                                  • Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this +

                                                                                  • listener: (...args: any[]) => void

                                                                                    The callback function

                                                                                    +

                                                                                  Returns this

                                                                                  v6.0.0

                                                                                  +
                                                                                  • Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.

                                                                                    server.prependOnceListener('connection', (stream) => {
                                                                                    console.log('Ah, we have our first user!');
                                                                                    });

                                                                                    Returns a reference to the EventEmitter, so that calls can be chained.

                                                                                    Type Parameters

                                                                                    • K

                                                                                    Parameters

                                                                                    • eventName: string | symbol

                                                                                      The name of the event.

                                                                                      -
                                                                                    • listener: (...args: any[]) => void

                                                                                      The callback function

                                                                                      -

                                                                                    Returns this

                                                                                    v6.0.0

                                                                                    -
                                                                                  • Returns a copy of the array of listeners for the event named eventName, +

                                                                                  • listener: (...args: any[]) => void

                                                                                    The callback function

                                                                                    +

                                                                                  Returns this

                                                                                  v6.0.0

                                                                                  +
                                                                                  • Returns a copy of the array of listeners for the event named eventName, including any wrappers (such as those created by .once()).

                                                                                    import { EventEmitter } from 'node:events';
                                                                                    const emitter = new EventEmitter();
                                                                                    emitter.once('log', () => console.log('log once'));

                                                                                    // Returns a new Array with a function `onceWrapper` which has a property
                                                                                    // `listener` which contains the original listener bound above
                                                                                    const listeners = emitter.rawListeners('log');
                                                                                    const logFnWrapper = listeners[0];

                                                                                    // Logs "log once" to the console and does not unbind the `once` event
                                                                                    logFnWrapper.listener();

                                                                                    // Logs "log once" to the console and removes the listener
                                                                                    logFnWrapper();

                                                                                    emitter.on('log', () => console.log('log persistently'));
                                                                                    // Will return a new Array with a single function bound by `.on()` above
                                                                                    const newListeners = emitter.rawListeners('log');

                                                                                    // Logs "log persistently" twice
                                                                                    newListeners[0]();
                                                                                    emitter.emit('log');

                                                                                    Type Parameters

                                                                                    • K

                                                                                    Parameters

                                                                                    • eventName: string | symbol

                                                                                    Returns Function[]

                                                                                    v9.4.0

                                                                                    -
                                                                                  • Removes all listeners, or those of the specified eventName.

                                                                                    +
                                                                                  • Removes all listeners, or those of the specified eventName.

                                                                                    It is bad practice to remove listeners added elsewhere in the code, particularly when the EventEmitter instance was created by some other component or module (e.g. sockets or file streams).

                                                                                    Returns a reference to the EventEmitter, so that calls can be chained.

                                                                                    Parameters

                                                                                    • OptionaleventName: string | symbol

                                                                                    Returns this

                                                                                    v0.1.26

                                                                                    -
                                                                                  • Removes the specified listener from the listener array for the event named eventName.

                                                                                    +
                                                                                  • Removes the specified listener from the listener array for the event named eventName.

                                                                                    const callback = (stream) => {
                                                                                    console.log('someone connected!');
                                                                                    };
                                                                                    server.on('connection', callback);
                                                                                    // ...
                                                                                    server.removeListener('connection', callback);
                                                                                    @@ -126,10 +126,10 @@ recently added instance. In the example the once('ping') listener i

                                                                                    Returns a reference to the EventEmitter, so that calls can be chained.

                                                                                    Type Parameters

                                                                                    • K

                                                                                    Parameters

                                                                                    • eventName: string | symbol
                                                                                    • listener: (...args: any[]) => void

                                                                                    Returns this

                                                                                    v0.1.26

                                                                                    -
                                                                                  • By default EventEmitters will print a warning if more than 10 listeners are +

                                                                                  • By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.

                                                                                    Returns a reference to the EventEmitter, so that calls can be chained.

                                                                                    Parameters

                                                                                    • n: number

                                                                                    Returns this

                                                                                    v0.3.5

                                                                                    -
                                                                                  +
                                                                                  diff --git a/docs/interfaces/src.IWorkerChoiceStrategy.html b/docs/interfaces/src.IWorkerChoiceStrategy.html index 40b245f39..4dc415c2f 100644 --- a/docs/interfaces/src.IWorkerChoiceStrategy.html +++ b/docs/interfaces/src.IWorkerChoiceStrategy.html @@ -1,5 +1,5 @@ -IWorkerChoiceStrategy | poolifier - v5.1.6
                                                                                  poolifier - v5.1.6
                                                                                    Preparing search index...

                                                                                    Interface IWorkerChoiceStrategyInternal

                                                                                    Worker choice strategy interface.

                                                                                    -
                                                                                    interface IWorkerChoiceStrategy {
                                                                                        choose: () => undefined | number;
                                                                                        name:
                                                                                            | "FAIR_SHARE"
                                                                                            | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                            | "LEAST_BUSY"
                                                                                            | "LEAST_ELU"
                                                                                            | "LEAST_USED"
                                                                                            | "ROUND_ROBIN"
                                                                                            | "WEIGHTED_ROUND_ROBIN";
                                                                                        remove: (workerNodeKey: number) => boolean;
                                                                                        reset: () => boolean;
                                                                                        retriesCount: number;
                                                                                        setOptions: (opts: undefined | WorkerChoiceStrategyOptions) => void;
                                                                                        strategyPolicy: StrategyPolicy;
                                                                                        taskStatisticsRequirements: TaskStatisticsRequirements;
                                                                                        update: (workerNodeKey: number) => boolean;
                                                                                    }
                                                                                    Index

                                                                                    Properties

                                                                                    choose +IWorkerChoiceStrategy | poolifier - v5.1.7
                                                                                    poolifier - v5.1.7
                                                                                      Preparing search index...

                                                                                      Interface IWorkerChoiceStrategyInternal

                                                                                      Worker choice strategy interface.

                                                                                      +
                                                                                      interface IWorkerChoiceStrategy {
                                                                                          choose: () => number | undefined;
                                                                                          name:
                                                                                              | "FAIR_SHARE"
                                                                                              | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                              | "LEAST_BUSY"
                                                                                              | "LEAST_ELU"
                                                                                              | "LEAST_USED"
                                                                                              | "ROUND_ROBIN"
                                                                                              | "WEIGHTED_ROUND_ROBIN";
                                                                                          remove: (workerNodeKey: number) => boolean;
                                                                                          reset: () => boolean;
                                                                                          retriesCount: number;
                                                                                          setOptions: (opts: WorkerChoiceStrategyOptions | undefined) => void;
                                                                                          strategyPolicy: StrategyPolicy;
                                                                                          taskStatisticsRequirements: TaskStatisticsRequirements;
                                                                                          update: (workerNodeKey: number) => boolean;
                                                                                      }
                                                                                      Index

                                                                                      Properties

                                                                                      choose: () => undefined | number

                                                                                      Chooses a worker node in the pool and returns its key. +

                                                                                      Properties

                                                                                      choose: () => number | undefined

                                                                                      Chooses a worker node in the pool and returns its key. If no worker nodes are not eligible, undefined is returned. If undefined is returned, the caller retry.

                                                                                      -

                                                                                      Type Declaration

                                                                                        • (): undefined | number
                                                                                        • Returns undefined | number

                                                                                          The worker node key or undefined.

                                                                                          -
                                                                                      name:
                                                                                          | "FAIR_SHARE"
                                                                                          | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                          | "LEAST_BUSY"
                                                                                          | "LEAST_ELU"
                                                                                          | "LEAST_USED"
                                                                                          | "ROUND_ROBIN"
                                                                                          | "WEIGHTED_ROUND_ROBIN"

                                                                                      The worker choice strategy name.

                                                                                      -
                                                                                      remove: (workerNodeKey: number) => boolean

                                                                                      Removes the worker node key from strategy internals.

                                                                                      +

                                                                                      Type Declaration

                                                                                        • (): number | undefined
                                                                                        • Returns number | undefined

                                                                                          The worker node key or undefined.

                                                                                          +
                                                                                      name:
                                                                                          | "FAIR_SHARE"
                                                                                          | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                          | "LEAST_BUSY"
                                                                                          | "LEAST_ELU"
                                                                                          | "LEAST_USED"
                                                                                          | "ROUND_ROBIN"
                                                                                          | "WEIGHTED_ROUND_ROBIN"

                                                                                      The worker choice strategy name.

                                                                                      +
                                                                                      remove: (workerNodeKey: number) => boolean

                                                                                      Removes the worker node key from strategy internals.

                                                                                      Type Declaration

                                                                                        • (workerNodeKey: number): boolean
                                                                                        • Parameters

                                                                                          • workerNodeKey: number

                                                                                            The worker node key.

                                                                                            -

                                                                                          Returns boolean

                                                                                          true if the worker node key is removed, false otherwise.

                                                                                          -
                                                                                      reset: () => boolean

                                                                                      Resets strategy internals.

                                                                                      +

                                                                                      Returns boolean

                                                                                      true if the worker node key is removed, false otherwise.

                                                                                      +
                                                                                      reset: () => boolean

                                                                                      Resets strategy internals.

                                                                                      Type Declaration

                                                                                        • (): boolean
                                                                                        • Returns boolean

                                                                                          true if the reset is successful, false otherwise.

                                                                                          -
                                                                                      retriesCount: number

                                                                                      The worker choice strategy execution retries count.

                                                                                      -
                                                                                      setOptions: (opts: undefined | WorkerChoiceStrategyOptions) => void

                                                                                      Sets the worker choice strategy options.

                                                                                      -

                                                                                      Type Declaration

                                                                                      strategyPolicy: StrategyPolicy

                                                                                      Strategy policy.

                                                                                      -
                                                                                      taskStatisticsRequirements: TaskStatisticsRequirements

                                                                                      Tasks statistics requirements.

                                                                                      -
                                                                                      update: (workerNodeKey: number) => boolean

                                                                                      Updates the worker node key strategy internals. +

                                                                                      retriesCount: number

                                                                                      The worker choice strategy execution retries count.

                                                                                      +
                                                                                      setOptions: (opts: WorkerChoiceStrategyOptions | undefined) => void

                                                                                      Sets the worker choice strategy options.

                                                                                      +

                                                                                      Type Declaration

                                                                                      strategyPolicy: StrategyPolicy

                                                                                      Strategy policy.

                                                                                      +
                                                                                      taskStatisticsRequirements: TaskStatisticsRequirements

                                                                                      Tasks statistics requirements.

                                                                                      +
                                                                                      update: (workerNodeKey: number) => boolean

                                                                                      Updates the worker node key strategy internals. This is called after a task has been executed on a worker node.

                                                                                      Type Declaration

                                                                                        • (workerNodeKey: number): boolean
                                                                                        • Parameters

                                                                                          • workerNodeKey: number

                                                                                          Returns boolean

                                                                                          true if the update is successful, false otherwise.

                                                                                          -
                                                                                      +
                                                                                      diff --git a/docs/interfaces/src.IWorkerNode.html b/docs/interfaces/src.IWorkerNode.html index b172c6f13..0622fe5c9 100644 --- a/docs/interfaces/src.IWorkerNode.html +++ b/docs/interfaces/src.IWorkerNode.html @@ -1,7 +1,7 @@ -IWorkerNode | poolifier - v5.1.6
                                                                                      poolifier - v5.1.6
                                                                                        Preparing search index...

                                                                                        Interface IWorkerNode<Worker, Data>Internal

                                                                                        Worker node interface.

                                                                                        -
                                                                                        interface IWorkerNode<Worker extends IWorker, Data = unknown> {
                                                                                            clearTasksQueue: () => void;
                                                                                            deleteTask: (task: Task<Data>) => boolean;
                                                                                            deleteTaskFunctionWorkerUsage: (name: string) => boolean;
                                                                                            dequeueLastPrioritizedTask: () => undefined | Task<Data>;
                                                                                            dequeueTask: (bucket?: number) => undefined | Task<Data>;
                                                                                            enqueueTask: (task: Task<Data>) => number;
                                                                                            getTaskFunctionWorkerUsage: (name: string) => undefined | WorkerUsage;
                                                                                            info: WorkerInfo;
                                                                                            messageChannel?: MessageChannel;
                                                                                            registerOnceWorkerEventHandler: (
                                                                                                event: string,
                                                                                                handler: EventHandler<Worker>,
                                                                                            ) => void;
                                                                                            registerWorkerEventHandler: (
                                                                                                event: string,
                                                                                                handler: EventHandler<Worker>,
                                                                                            ) => void;
                                                                                            setTasksQueuePriority: (enablePriority: boolean) => void;
                                                                                            strategyData?: StrategyData;
                                                                                            tasksQueue: PriorityQueue<Task<Data>>;
                                                                                            tasksQueueBackPressureSize: number;
                                                                                            tasksQueueSize: () => number;
                                                                                            terminate: () => Promise<void>;
                                                                                            usage: WorkerUsage;
                                                                                            worker: Worker;
                                                                                            "[captureRejectionSymbol]"?<K>(
                                                                                                error: Error,
                                                                                                event: string | symbol,
                                                                                                ...args: AnyRest,
                                                                                            ): void;
                                                                                            addListener<K>(
                                                                                                eventName: string | symbol,
                                                                                                listener: (...args: any[]) => void,
                                                                                            ): this;
                                                                                            emit<K>(eventName: string | symbol, ...args: AnyRest): boolean;
                                                                                            eventNames(): (string | symbol)[];
                                                                                            getMaxListeners(): number;
                                                                                            listenerCount<K>(eventName: string | symbol, listener?: Function): number;
                                                                                            listeners<K>(eventName: string | symbol): Function[];
                                                                                            off<K>(
                                                                                                eventName: string | symbol,
                                                                                                listener: (...args: any[]) => void,
                                                                                            ): this;
                                                                                            on<K>(eventName: string | symbol, listener: (...args: any[]) => void): this;
                                                                                            once<K>(
                                                                                                eventName: string | symbol,
                                                                                                listener: (...args: any[]) => void,
                                                                                            ): this;
                                                                                            prependListener<K>(
                                                                                                eventName: string | symbol,
                                                                                                listener: (...args: any[]) => void,
                                                                                            ): this;
                                                                                            prependOnceListener<K>(
                                                                                                eventName: string | symbol,
                                                                                                listener: (...args: any[]) => void,
                                                                                            ): this;
                                                                                            rawListeners<K>(eventName: string | symbol): Function[];
                                                                                            removeAllListeners(eventName?: string | symbol): this;
                                                                                            removeListener<K>(
                                                                                                eventName: string | symbol,
                                                                                                listener: (...args: any[]) => void,
                                                                                            ): this;
                                                                                            setMaxListeners(n: number): this;
                                                                                        }

                                                                                        Type Parameters

                                                                                        • Worker extends IWorker

                                                                                          Type of worker.

                                                                                          -
                                                                                        • Data = unknown

                                                                                          Type of data sent to the worker. This can only be structured-cloneable data.

                                                                                          -

                                                                                        Hierarchy

                                                                                        • EventEmitter
                                                                                          • IWorkerNode
                                                                                        Index

                                                                                        Properties

                                                                                        clearTasksQueue +IWorkerNode | poolifier - v5.1.7
                                                                                        poolifier - v5.1.7
                                                                                          Preparing search index...

                                                                                          Interface IWorkerNode<Worker, Data>Internal

                                                                                          Worker node interface.

                                                                                          +
                                                                                          interface IWorkerNode<Worker extends IWorker, Data = unknown> {
                                                                                              clearTasksQueue: () => void;
                                                                                              deleteTask: (task: Task<Data>) => boolean;
                                                                                              deleteTaskFunctionWorkerUsage: (name: string) => boolean;
                                                                                              dequeueLastPrioritizedTask: () => Task<Data> | undefined;
                                                                                              dequeueTask: (bucket?: number) => Task<Data> | undefined;
                                                                                              enqueueTask: (task: Task<Data>) => number;
                                                                                              getTaskFunctionWorkerUsage: (name: string) => WorkerUsage | undefined;
                                                                                              info: WorkerInfo;
                                                                                              messageChannel?: MessageChannel;
                                                                                              registerOnceWorkerEventHandler: (
                                                                                                  event: string,
                                                                                                  handler: EventHandler<Worker>,
                                                                                              ) => void;
                                                                                              registerWorkerEventHandler: (
                                                                                                  event: string,
                                                                                                  handler: EventHandler<Worker>,
                                                                                              ) => void;
                                                                                              setTasksQueuePriority: (enablePriority: boolean) => void;
                                                                                              strategyData?: StrategyData;
                                                                                              tasksQueue: PriorityQueue<Task<Data>>;
                                                                                              tasksQueueBackPressureSize: number;
                                                                                              tasksQueueSize: () => number;
                                                                                              terminate: () => Promise<void>;
                                                                                              usage: WorkerUsage;
                                                                                              worker: Worker;
                                                                                              "[captureRejectionSymbol]"?<K>(
                                                                                                  error: Error,
                                                                                                  event: string | symbol,
                                                                                                  ...args: AnyRest,
                                                                                              ): void;
                                                                                              addListener<K>(
                                                                                                  eventName: string | symbol,
                                                                                                  listener: (...args: any[]) => void,
                                                                                              ): this;
                                                                                              emit<K>(eventName: string | symbol, ...args: AnyRest): boolean;
                                                                                              eventNames(): (string | symbol)[];
                                                                                              getMaxListeners(): number;
                                                                                              listenerCount<K>(eventName: string | symbol, listener?: Function): number;
                                                                                              listeners<K>(eventName: string | symbol): Function[];
                                                                                              off<K>(
                                                                                                  eventName: string | symbol,
                                                                                                  listener: (...args: any[]) => void,
                                                                                              ): this;
                                                                                              on<K>(eventName: string | symbol, listener: (...args: any[]) => void): this;
                                                                                              once<K>(
                                                                                                  eventName: string | symbol,
                                                                                                  listener: (...args: any[]) => void,
                                                                                              ): this;
                                                                                              prependListener<K>(
                                                                                                  eventName: string | symbol,
                                                                                                  listener: (...args: any[]) => void,
                                                                                              ): this;
                                                                                              prependOnceListener<K>(
                                                                                                  eventName: string | symbol,
                                                                                                  listener: (...args: any[]) => void,
                                                                                              ): this;
                                                                                              rawListeners<K>(eventName: string | symbol): Function[];
                                                                                              removeAllListeners(eventName?: string | symbol): this;
                                                                                              removeListener<K>(
                                                                                                  eventName: string | symbol,
                                                                                                  listener: (...args: any[]) => void,
                                                                                              ): this;
                                                                                              setMaxListeners(n: number): this;
                                                                                          }

                                                                                          Type Parameters

                                                                                          • Worker extends IWorker

                                                                                            Type of worker.

                                                                                            +
                                                                                          • Data = unknown

                                                                                            Type of data sent to the worker. This can only be structured-cloneable data.

                                                                                            +

                                                                                          Hierarchy

                                                                                          • EventEmitter
                                                                                            • IWorkerNode
                                                                                          Index

                                                                                          Properties

                                                                                          clearTasksQueue: () => void

                                                                                          Clears tasks queue.

                                                                                          -
                                                                                          deleteTask: (task: Task<Data>) => boolean

                                                                                          Deletes a task from the tasks queue.

                                                                                          +
                                                                                          deleteTask: (task: Task<Data>) => boolean

                                                                                          Deletes a task from the tasks queue.

                                                                                          Type Declaration

                                                                                            • (task: Task<Data>): boolean
                                                                                            • Parameters

                                                                                              Returns boolean

                                                                                              true if the task was deleted, false otherwise.

                                                                                              -
                                                                                          deleteTaskFunctionWorkerUsage: (name: string) => boolean

                                                                                          Deletes task function worker usage statistics.

                                                                                          +

                                                                                          Returns boolean

                                                                                          true if the task was deleted, false otherwise.

                                                                                          +
                                                                                          deleteTaskFunctionWorkerUsage: (name: string) => boolean

                                                                                          Deletes task function worker usage statistics.

                                                                                          Type Declaration

                                                                                            • (name: string): boolean
                                                                                            • Parameters

                                                                                              • name: string

                                                                                                The task function name.

                                                                                                -

                                                                                              Returns boolean

                                                                                              true if the task function worker usage statistics were deleted, false otherwise.

                                                                                              -
                                                                                          dequeueLastPrioritizedTask: () => undefined | Task<Data>

                                                                                          Dequeue last prioritized task.

                                                                                          -

                                                                                          Type Declaration

                                                                                          dequeueTask: (bucket?: number) => undefined | Task<Data>

                                                                                          Dequeue task.

                                                                                          -

                                                                                          Type Declaration

                                                                                            • (bucket?: number): undefined | Task<Data>
                                                                                            • Parameters

                                                                                              • Optionalbucket: number

                                                                                                The prioritized bucket to dequeue from.

                                                                                                -

                                                                                              Returns undefined | Task<Data>

                                                                                              The dequeued task.

                                                                                              -
                                                                                          0
                                                                                          +

                                                                                          Returns boolean

                                                                                          true if the task function worker usage statistics were deleted, false otherwise.

                                                                                          +
                                                                                          dequeueLastPrioritizedTask: () => Task<Data> | undefined

                                                                                          Dequeue last prioritized task.

                                                                                          +

                                                                                          Type Declaration

                                                                                          dequeueTask: (bucket?: number) => Task<Data> | undefined

                                                                                          Dequeue task.

                                                                                          +

                                                                                          Type Declaration

                                                                                            • (bucket?: number): Task<Data> | undefined
                                                                                            • Parameters

                                                                                              • Optionalbucket: number

                                                                                                The prioritized bucket to dequeue from.

                                                                                                +

                                                                                              Returns Task<Data> | undefined

                                                                                              The dequeued task.

                                                                                              +
                                                                                          0
                                                                                           
                                                                                          -
                                                                                          enqueueTask: (task: Task<Data>) => number

                                                                                          Enqueue task.

                                                                                          +
                                                                                          enqueueTask: (task: Task<Data>) => number

                                                                                          Enqueue task.

                                                                                          Type Declaration

                                                                                            • (task: Task<Data>): number
                                                                                            • Parameters

                                                                                              Returns number

                                                                                              The tasks queue size.

                                                                                              -
                                                                                          getTaskFunctionWorkerUsage: (name: string) => undefined | WorkerUsage

                                                                                          Gets task function worker usage statistics.

                                                                                          -

                                                                                          Type Declaration

                                                                                            • (name: string): undefined | WorkerUsage
                                                                                            • Parameters

                                                                                              • name: string

                                                                                                The task function name.

                                                                                                -

                                                                                              Returns undefined | WorkerUsage

                                                                                              The task function worker usage statistics if the task function worker usage statistics are initialized, undefined otherwise.

                                                                                              -

                                                                                          Worker info.

                                                                                          -
                                                                                          messageChannel?: MessageChannel

                                                                                          Message channel (worker thread only).

                                                                                          -
                                                                                          registerOnceWorkerEventHandler: (
                                                                                              event: string,
                                                                                              handler: EventHandler<Worker>,
                                                                                          ) => void

                                                                                          Registers once a worker event handler.

                                                                                          +

                                                                                          Returns number

                                                                                          The tasks queue size.

                                                                                          +
                                                                                          getTaskFunctionWorkerUsage: (name: string) => WorkerUsage | undefined

                                                                                          Gets task function worker usage statistics.

                                                                                          +

                                                                                          Type Declaration

                                                                                            • (name: string): WorkerUsage | undefined
                                                                                            • Parameters

                                                                                              • name: string

                                                                                                The task function name.

                                                                                                +

                                                                                              Returns WorkerUsage | undefined

                                                                                              The task function worker usage statistics if the task function worker usage statistics are initialized, undefined otherwise.

                                                                                              +

                                                                                          Worker info.

                                                                                          +
                                                                                          messageChannel?: MessageChannel

                                                                                          Message channel (worker thread only).

                                                                                          +
                                                                                          registerOnceWorkerEventHandler: (
                                                                                              event: string,
                                                                                              handler: EventHandler<Worker>,
                                                                                          ) => void

                                                                                          Registers once a worker event handler.

                                                                                          Type Declaration

                                                                                          registerWorkerEventHandler: (
                                                                                              event: string,
                                                                                              handler: EventHandler<Worker>,
                                                                                          ) => void

                                                                                          Registers a worker event handler.

                                                                                          +
                                                                                        • handler: EventHandler<Worker>

                                                                                          The event handler.

                                                                                          +
                                                                                        • Returns void

                                                                                          registerWorkerEventHandler: (
                                                                                              event: string,
                                                                                              handler: EventHandler<Worker>,
                                                                                          ) => void

                                                                                          Registers a worker event handler.

                                                                                          Type Declaration

                                                                                          setTasksQueuePriority: (enablePriority: boolean) => void

                                                                                          Sets tasks queue priority.

                                                                                          +
                                                                                        • handler: EventHandler<Worker>

                                                                                          The event handler.

                                                                                          +
                                                                                        • Returns void

                                                                                          setTasksQueuePriority: (enablePriority: boolean) => void

                                                                                          Sets tasks queue priority.

                                                                                          Type Declaration

                                                                                            • (enablePriority: boolean): void
                                                                                            • Parameters

                                                                                              • enablePriority: boolean

                                                                                                Whether to enable tasks queue priority.

                                                                                                -

                                                                                              Returns void

                                                                                          strategyData?: StrategyData

                                                                                          Worker choice strategy data. +

                                                                                          Returns void

                                                                                          strategyData?: StrategyData

                                                                                          Worker choice strategy data. This is used to store data that are specific to the worker choice strategy.

                                                                                          -
                                                                                          tasksQueue: PriorityQueue<Task<Data>>

                                                                                          Tasks queue.

                                                                                          -
                                                                                          tasksQueueBackPressureSize: number

                                                                                          Tasks queue back pressure size. +

                                                                                          tasksQueue: PriorityQueue<Task<Data>>

                                                                                          Tasks queue.

                                                                                          +
                                                                                          tasksQueueBackPressureSize: number

                                                                                          Tasks queue back pressure size. This is the number of tasks that can be enqueued before the worker node has back pressure.

                                                                                          -
                                                                                          tasksQueueSize: () => number

                                                                                          Tasks queue size.

                                                                                          +
                                                                                          tasksQueueSize: () => number

                                                                                          Tasks queue size.

                                                                                          Type Declaration

                                                                                            • (): number
                                                                                            • Returns number

                                                                                              The tasks queue size.

                                                                                              -
                                                                                          terminate: () => Promise<void>

                                                                                          Terminates the worker node.

                                                                                          -

                                                                                          Worker usage statistics.

                                                                                          -
                                                                                          worker: Worker

                                                                                          Worker.

                                                                                          -

                                                                                          Methods

                                                                                          • Type Parameters

                                                                                            • K

                                                                                            Parameters

                                                                                            • error: Error
                                                                                            • event: string | symbol
                                                                                            • ...args: AnyRest

                                                                                            Returns void

                                                                                          • Alias for emitter.on(eventName, listener).

                                                                                            +
                                                                                          terminate: () => Promise<void>

                                                                                          Terminates the worker node.

                                                                                          +

                                                                                          Worker usage statistics.

                                                                                          +
                                                                                          worker: Worker

                                                                                          Worker.

                                                                                          +

                                                                                          Methods

                                                                                          • Type Parameters

                                                                                            • K

                                                                                            Parameters

                                                                                            • error: Error
                                                                                            • event: string | symbol
                                                                                            • ...args: AnyRest

                                                                                            Returns void

                                                                                          • Alias for emitter.on(eventName, listener).

                                                                                            Type Parameters

                                                                                            • K

                                                                                            Parameters

                                                                                            • eventName: string | symbol
                                                                                            • listener: (...args: any[]) => void

                                                                                            Returns this

                                                                                            v0.1.26

                                                                                            -
                                                                                          • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments +

                                                                                          • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

                                                                                            Returns true if the event had listeners, false otherwise.

                                                                                            import { EventEmitter } from 'node:events';
                                                                                            const myEmitter = new EventEmitter();

                                                                                            // First listener
                                                                                            myEmitter.on('event', function firstListener() {
                                                                                            console.log('Helloooo! first listener');
                                                                                            });
                                                                                            // Second listener
                                                                                            myEmitter.on('event', function secondListener(arg1, arg2) {
                                                                                            console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
                                                                                            });
                                                                                            // Third listener
                                                                                            myEmitter.on('event', function thirdListener(...args) {
                                                                                            const parameters = args.join(', ');
                                                                                            console.log(`event with parameters ${parameters} in third listener`);
                                                                                            });

                                                                                            console.log(myEmitter.listeners('event'));

                                                                                            myEmitter.emit('event', 1, 2, 3, 4, 5);

                                                                                            // Prints:
                                                                                            // [
                                                                                            // [Function: firstListener],
                                                                                            // [Function: secondListener],
                                                                                            // [Function: thirdListener]
                                                                                            // ]
                                                                                            // Helloooo! first listener
                                                                                            // event with parameters 1, 2 in second listener
                                                                                            // event with parameters 1, 2, 3, 4, 5 in third listener

                                                                                            Type Parameters

                                                                                            • K

                                                                                            Parameters

                                                                                            • eventName: string | symbol
                                                                                            • ...args: AnyRest

                                                                                            Returns boolean

                                                                                            v0.1.26

                                                                                            -
                                                                                          • Returns an array listing the events for which the emitter has registered +

                                                                                          • Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.

                                                                                            import { EventEmitter } from 'node:events';

                                                                                            const myEE = new EventEmitter();
                                                                                            myEE.on('foo', () => {});
                                                                                            myEE.on('bar', () => {});

                                                                                            const sym = Symbol('symbol');
                                                                                            myEE.on(sym, () => {});

                                                                                            console.log(myEE.eventNames());
                                                                                            // Prints: [ 'foo', 'bar', Symbol(symbol) ]

                                                                                            Returns (string | symbol)[]

                                                                                            v6.0.0

                                                                                            -
                                                                                          • Returns the current max listener value for the EventEmitter which is either +

                                                                                          • Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to EventEmitter.defaultMaxListeners.

                                                                                            Returns number

                                                                                            v1.0.0

                                                                                            -
                                                                                          • Returns the number of listeners listening for the event named eventName. +

                                                                                          • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

                                                                                            Type Parameters

                                                                                            • K

                                                                                            Parameters

                                                                                            • eventName: string | symbol

                                                                                              The name of the event being listened for

                                                                                              -
                                                                                            • Optionallistener: Function

                                                                                              The event handler function

                                                                                              -

                                                                                            Returns number

                                                                                            v3.2.0

                                                                                            -
                                                                                          • Returns a copy of the array of listeners for the event named eventName.

                                                                                            +
                                                                                          • Optionallistener: Function

                                                                                            The event handler function

                                                                                            +

                                                                                          Returns number

                                                                                          v3.2.0

                                                                                          +
                                                                                          • Returns a copy of the array of listeners for the event named eventName.

                                                                                            server.on('connection', (stream) => {
                                                                                            console.log('someone connected!');
                                                                                            });
                                                                                            console.log(util.inspect(server.listeners('connection')));
                                                                                            // Prints: [ [Function] ]

                                                                                            Type Parameters

                                                                                            • K

                                                                                            Parameters

                                                                                            • eventName: string | symbol

                                                                                            Returns Function[]

                                                                                            v0.1.26

                                                                                            -
                                                                                          • Alias for emitter.removeListener().

                                                                                            +
                                                                                          • Alias for emitter.removeListener().

                                                                                            Type Parameters

                                                                                            • K

                                                                                            Parameters

                                                                                            • eventName: string | symbol
                                                                                            • listener: (...args: any[]) => void

                                                                                            Returns this

                                                                                            v10.0.0

                                                                                            -
                                                                                          • Adds the listener function to the end of the listeners array for the event +

                                                                                          • Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.

                                                                                            @@ -122,9 +122,9 @@ event listener to the beginning of the listeners array.

                                                                                            Type Parameters

                                                                                            • K

                                                                                            Parameters

                                                                                            • eventName: string | symbol

                                                                                              The name of the event.

                                                                                              -
                                                                                            • listener: (...args: any[]) => void

                                                                                              The callback function

                                                                                              -

                                                                                            Returns this

                                                                                            v0.1.101

                                                                                            -
                                                                                          • Adds a one-time listener function for the event named eventName. The +

                                                                                          • listener: (...args: any[]) => void

                                                                                            The callback function

                                                                                            +

                                                                                          Returns this

                                                                                          v0.1.101

                                                                                          +
                                                                                          • Adds a one-time listener function for the event named eventName. The next time eventName is triggered, this listener is removed and then invoked.

                                                                                            server.once('connection', (stream) => {
                                                                                            console.log('Ah, we have our first user!');
                                                                                            });
                                                                                            @@ -136,9 +136,9 @@ event listener to the beginning of the listeners array.

                                                                                            Type Parameters

                                                                                            • K

                                                                                            Parameters

                                                                                            • eventName: string | symbol

                                                                                              The name of the event.

                                                                                              -
                                                                                            • listener: (...args: any[]) => void

                                                                                              The callback function

                                                                                              -

                                                                                            Returns this

                                                                                            v0.3.0

                                                                                            -
                                                                                          • Adds the listener function to the beginning of the listeners array for the +

                                                                                          • listener: (...args: any[]) => void

                                                                                            The callback function

                                                                                            +

                                                                                          Returns this

                                                                                          v0.3.0

                                                                                          +
                                                                                          • Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.

                                                                                            @@ -147,30 +147,30 @@ and listener will result in the listener being added,

                                                                                            Returns a reference to the EventEmitter, so that calls can be chained.

                                                                                            Type Parameters

                                                                                            • K

                                                                                            Parameters

                                                                                            • eventName: string | symbol

                                                                                              The name of the event.

                                                                                              -
                                                                                            • listener: (...args: any[]) => void

                                                                                              The callback function

                                                                                              -

                                                                                            Returns this

                                                                                            v6.0.0

                                                                                            -
                                                                                          • Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this +

                                                                                          • listener: (...args: any[]) => void

                                                                                            The callback function

                                                                                            +

                                                                                          Returns this

                                                                                          v6.0.0

                                                                                          +
                                                                                          • Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.

                                                                                            server.prependOnceListener('connection', (stream) => {
                                                                                            console.log('Ah, we have our first user!');
                                                                                            });

                                                                                            Returns a reference to the EventEmitter, so that calls can be chained.

                                                                                            Type Parameters

                                                                                            • K

                                                                                            Parameters

                                                                                            • eventName: string | symbol

                                                                                              The name of the event.

                                                                                              -
                                                                                            • listener: (...args: any[]) => void

                                                                                              The callback function

                                                                                              -

                                                                                            Returns this

                                                                                            v6.0.0

                                                                                            -
                                                                                          • Returns a copy of the array of listeners for the event named eventName, +

                                                                                          • listener: (...args: any[]) => void

                                                                                            The callback function

                                                                                            +

                                                                                          Returns this

                                                                                          v6.0.0

                                                                                          +
                                                                                          • Returns a copy of the array of listeners for the event named eventName, including any wrappers (such as those created by .once()).

                                                                                            import { EventEmitter } from 'node:events';
                                                                                            const emitter = new EventEmitter();
                                                                                            emitter.once('log', () => console.log('log once'));

                                                                                            // Returns a new Array with a function `onceWrapper` which has a property
                                                                                            // `listener` which contains the original listener bound above
                                                                                            const listeners = emitter.rawListeners('log');
                                                                                            const logFnWrapper = listeners[0];

                                                                                            // Logs "log once" to the console and does not unbind the `once` event
                                                                                            logFnWrapper.listener();

                                                                                            // Logs "log once" to the console and removes the listener
                                                                                            logFnWrapper();

                                                                                            emitter.on('log', () => console.log('log persistently'));
                                                                                            // Will return a new Array with a single function bound by `.on()` above
                                                                                            const newListeners = emitter.rawListeners('log');

                                                                                            // Logs "log persistently" twice
                                                                                            newListeners[0]();
                                                                                            emitter.emit('log');

                                                                                            Type Parameters

                                                                                            • K

                                                                                            Parameters

                                                                                            • eventName: string | symbol

                                                                                            Returns Function[]

                                                                                            v9.4.0

                                                                                            -
                                                                                          • Removes all listeners, or those of the specified eventName.

                                                                                            +
                                                                                          • Removes all listeners, or those of the specified eventName.

                                                                                            It is bad practice to remove listeners added elsewhere in the code, particularly when the EventEmitter instance was created by some other component or module (e.g. sockets or file streams).

                                                                                            Returns a reference to the EventEmitter, so that calls can be chained.

                                                                                            Parameters

                                                                                            • OptionaleventName: string | symbol

                                                                                            Returns this

                                                                                            v0.1.26

                                                                                            -
                                                                                          • Removes the specified listener from the listener array for the event named eventName.

                                                                                            +
                                                                                          • Removes the specified listener from the listener array for the event named eventName.

                                                                                            const callback = (stream) => {
                                                                                            console.log('someone connected!');
                                                                                            };
                                                                                            server.on('connection', callback);
                                                                                            // ...
                                                                                            server.removeListener('connection', callback);
                                                                                            @@ -197,10 +197,10 @@ recently added instance. In the example the once('ping') listener i

                                                                                            Returns a reference to the EventEmitter, so that calls can be chained.

                                                                                            Type Parameters

                                                                                            • K

                                                                                            Parameters

                                                                                            • eventName: string | symbol
                                                                                            • listener: (...args: any[]) => void

                                                                                            Returns this

                                                                                            v0.1.26

                                                                                            -
                                                                                          • By default EventEmitters will print a warning if more than 10 listeners are +

                                                                                          • By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.

                                                                                            Returns a reference to the EventEmitter, so that calls can be chained.

                                                                                            Parameters

                                                                                            • n: number

                                                                                            Returns this

                                                                                            v0.3.5

                                                                                            -
                                                                                          +
                                                                                          diff --git a/docs/interfaces/src.MeasurementOptions.html b/docs/interfaces/src.MeasurementOptions.html index f0e4494f6..965319ab5 100644 --- a/docs/interfaces/src.MeasurementOptions.html +++ b/docs/interfaces/src.MeasurementOptions.html @@ -1,4 +1,4 @@ -MeasurementOptions | poolifier - v5.1.6
                                                                                          poolifier - v5.1.6
                                                                                            Preparing search index...

                                                                                            Interface MeasurementOptions

                                                                                            Measurement options.

                                                                                            -
                                                                                            interface MeasurementOptions {
                                                                                                median: boolean;
                                                                                            }
                                                                                            Index

                                                                                            Properties

                                                                                            median +MeasurementOptions | poolifier - v5.1.7
                                                                                            poolifier - v5.1.7
                                                                                              Preparing search index...

                                                                                              Interface MeasurementOptions

                                                                                              Measurement options.

                                                                                              +
                                                                                              interface MeasurementOptions {
                                                                                                  median: boolean;
                                                                                              }
                                                                                              Index

                                                                                              Properties

                                                                                              Properties

                                                                                              median: boolean

                                                                                              Set measurement median.

                                                                                              -
                                                                                              +
                                                                                              diff --git a/docs/interfaces/src.MeasurementStatistics.html b/docs/interfaces/src.MeasurementStatistics.html index e84a3cd71..b6004b543 100644 --- a/docs/interfaces/src.MeasurementStatistics.html +++ b/docs/interfaces/src.MeasurementStatistics.html @@ -1,14 +1,14 @@ -MeasurementStatistics | poolifier - v5.1.6
                                                                                              poolifier - v5.1.6
                                                                                                Preparing search index...

                                                                                                Interface MeasurementStatisticsInternal

                                                                                                Measurement statistics.

                                                                                                -
                                                                                                interface MeasurementStatistics {
                                                                                                    aggregate?: number;
                                                                                                    average?: number;
                                                                                                    history: CircularBuffer;
                                                                                                    maximum?: number;
                                                                                                    median?: number;
                                                                                                    minimum?: number;
                                                                                                }
                                                                                                Index

                                                                                                Properties

                                                                                                aggregate? +MeasurementStatistics | poolifier - v5.1.7
                                                                                                poolifier - v5.1.7
                                                                                                  Preparing search index...

                                                                                                  Interface MeasurementStatisticsInternal

                                                                                                  Measurement statistics.

                                                                                                  +
                                                                                                  interface MeasurementStatistics {
                                                                                                      aggregate?: number;
                                                                                                      average?: number;
                                                                                                      history: CircularBuffer;
                                                                                                      maximum?: number;
                                                                                                      median?: number;
                                                                                                      minimum?: number;
                                                                                                  }
                                                                                                  Index

                                                                                                  Properties

                                                                                                  aggregate?: number

                                                                                                  Measurement aggregate.

                                                                                                  -
                                                                                                  average?: number

                                                                                                  Measurement average.

                                                                                                  -

                                                                                                  Measurement history.

                                                                                                  -
                                                                                                  maximum?: number

                                                                                                  Measurement maximum.

                                                                                                  -
                                                                                                  median?: number

                                                                                                  Measurement median.

                                                                                                  -
                                                                                                  minimum?: number

                                                                                                  Measurement minimum.

                                                                                                  -
                                                                                                  +
                                                                                                  average?: number

                                                                                                  Measurement average.

                                                                                                  +

                                                                                                  Measurement history.

                                                                                                  +
                                                                                                  maximum?: number

                                                                                                  Measurement maximum.

                                                                                                  +
                                                                                                  median?: number

                                                                                                  Measurement median.

                                                                                                  +
                                                                                                  minimum?: number

                                                                                                  Measurement minimum.

                                                                                                  +
                                                                                                  diff --git a/docs/interfaces/src.MeasurementStatisticsRequirements.html b/docs/interfaces/src.MeasurementStatisticsRequirements.html index 29fe45904..b1b1bbe22 100644 --- a/docs/interfaces/src.MeasurementStatisticsRequirements.html +++ b/docs/interfaces/src.MeasurementStatisticsRequirements.html @@ -1,8 +1,8 @@ -MeasurementStatisticsRequirements | poolifier - v5.1.6
                                                                                                  poolifier - v5.1.6
                                                                                                    Preparing search index...

                                                                                                    Interface MeasurementStatisticsRequirementsInternal

                                                                                                    Measurement statistics requirements.

                                                                                                    -
                                                                                                    interface MeasurementStatisticsRequirements {
                                                                                                        aggregate: boolean;
                                                                                                        average: boolean;
                                                                                                        median: boolean;
                                                                                                    }
                                                                                                    Index

                                                                                                    Properties

                                                                                                    aggregate +MeasurementStatisticsRequirements | poolifier - v5.1.7
                                                                                                    poolifier - v5.1.7
                                                                                                      Preparing search index...

                                                                                                      Interface MeasurementStatisticsRequirementsInternal

                                                                                                      Measurement statistics requirements.

                                                                                                      +
                                                                                                      interface MeasurementStatisticsRequirements {
                                                                                                          aggregate: boolean;
                                                                                                          average: boolean;
                                                                                                          median: boolean;
                                                                                                      }
                                                                                                      Index

                                                                                                      Properties

                                                                                                      aggregate: boolean

                                                                                                      Requires measurement aggregate.

                                                                                                      -
                                                                                                      average: boolean

                                                                                                      Requires measurement average.

                                                                                                      -
                                                                                                      median: boolean

                                                                                                      Requires measurement median.

                                                                                                      -
                                                                                                      +
                                                                                                      average: boolean

                                                                                                      Requires measurement average.

                                                                                                      +
                                                                                                      median: boolean

                                                                                                      Requires measurement median.

                                                                                                      +
                                                                                                      diff --git a/docs/interfaces/src.MessageValue.html b/docs/interfaces/src.MessageValue.html index 0a105a562..e3b30f3f0 100644 --- a/docs/interfaces/src.MessageValue.html +++ b/docs/interfaces/src.MessageValue.html @@ -1,7 +1,7 @@ -MessageValue | poolifier - v5.1.6
                                                                                                      poolifier - v5.1.6
                                                                                                        Preparing search index...

                                                                                                        Interface MessageValue<Data, ErrorData>Internal

                                                                                                        Message object that is passed between main worker and worker.

                                                                                                        -
                                                                                                        interface MessageValue<Data = unknown, ErrorData = unknown> {
                                                                                                            abortable?: boolean;
                                                                                                            checkActive?: boolean;
                                                                                                            data?: Data;
                                                                                                            kill?: true | "success" | "HARD" | "SOFT" | "failure";
                                                                                                            name?: string;
                                                                                                            port?: MessagePort;
                                                                                                            priority?: number;
                                                                                                            ready?: boolean;
                                                                                                            statistics?: WorkerStatistics;
                                                                                                            strategy?:
                                                                                                                | "FAIR_SHARE"
                                                                                                                | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                | "LEAST_BUSY"
                                                                                                                | "LEAST_ELU"
                                                                                                                | "LEAST_USED"
                                                                                                                | "ROUND_ROBIN"
                                                                                                                | "WEIGHTED_ROUND_ROBIN";
                                                                                                            taskFunction?: string;
                                                                                                            taskFunctionOperation?: "add"
                                                                                                            | "default"
                                                                                                            | "remove";
                                                                                                            taskFunctionOperationStatus?: boolean;
                                                                                                            taskFunctionProperties?: TaskFunctionProperties;
                                                                                                            taskFunctionsProperties?: TaskFunctionProperties[];
                                                                                                            taskId?: `${string}-${string}-${string}-${string}-${string}`;
                                                                                                            taskOperation?: "abort";
                                                                                                            taskPerformance?: TaskPerformance;
                                                                                                            timestamp?: number;
                                                                                                            transferList?: readonly Transferable[];
                                                                                                            workerError?: WorkerError<ErrorData>;
                                                                                                            workerId?: number;
                                                                                                        }

                                                                                                        Type Parameters

                                                                                                        • Data = unknown

                                                                                                          Type of data sent to the worker or execution response. This can only be structured-cloneable data.

                                                                                                          -
                                                                                                        • ErrorData = unknown

                                                                                                          Type of data sent to the worker triggering an error. This can only be structured-cloneable data.

                                                                                                          -

                                                                                                        Hierarchy (View Summary)

                                                                                                        Index

                                                                                                        Properties

                                                                                                        abortable? +MessageValue | poolifier - v5.1.7
                                                                                                        poolifier - v5.1.7
                                                                                                          Preparing search index...

                                                                                                          Interface MessageValue<Data, ErrorData>Internal

                                                                                                          Message object that is passed between main worker and worker.

                                                                                                          +
                                                                                                          interface MessageValue<Data = unknown, ErrorData = unknown> {
                                                                                                              abortable?: boolean;
                                                                                                              checkActive?: boolean;
                                                                                                              data?: Data;
                                                                                                              kill?: true | "success" | "HARD" | "SOFT" | "failure";
                                                                                                              name?: string;
                                                                                                              port?: MessagePort;
                                                                                                              priority?: number;
                                                                                                              ready?: boolean;
                                                                                                              statistics?: WorkerStatistics;
                                                                                                              strategy?:
                                                                                                                  | "FAIR_SHARE"
                                                                                                                  | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                  | "LEAST_BUSY"
                                                                                                                  | "LEAST_ELU"
                                                                                                                  | "LEAST_USED"
                                                                                                                  | "ROUND_ROBIN"
                                                                                                                  | "WEIGHTED_ROUND_ROBIN";
                                                                                                              taskFunction?: string;
                                                                                                              taskFunctionOperation?: "add"
                                                                                                              | "default"
                                                                                                              | "remove";
                                                                                                              taskFunctionOperationStatus?: boolean;
                                                                                                              taskFunctionProperties?: TaskFunctionProperties;
                                                                                                              taskFunctionsProperties?: TaskFunctionProperties[];
                                                                                                              taskId?: `${string}-${string}-${string}-${string}-${string}`;
                                                                                                              taskOperation?: "abort";
                                                                                                              taskPerformance?: TaskPerformance;
                                                                                                              timestamp?: number;
                                                                                                              transferList?: readonly Transferable[];
                                                                                                              workerError?: WorkerError<ErrorData>;
                                                                                                              workerId?: number;
                                                                                                          }

                                                                                                          Type Parameters

                                                                                                          • Data = unknown

                                                                                                            Type of data sent to the worker or execution response. This can only be structured-cloneable data.

                                                                                                            +
                                                                                                          • ErrorData = unknown

                                                                                                            Type of data sent to the worker triggering an error. This can only be structured-cloneable data.

                                                                                                            +

                                                                                                          Hierarchy (View Summary)

                                                                                                          Index

                                                                                                          Properties

                                                                                                          Properties

                                                                                                          abortable?: boolean

                                                                                                          Whether the task is abortable or not.

                                                                                                          -
                                                                                                          checkActive?: boolean

                                                                                                          Whether the worker starts or stops its activity check.

                                                                                                          -
                                                                                                          data?: Data

                                                                                                          Task input data that will be passed to the worker.

                                                                                                          -
                                                                                                          kill?: true | "success" | "HARD" | "SOFT" | "failure"

                                                                                                          Kill code.

                                                                                                          -
                                                                                                          name?: string

                                                                                                          Task name.

                                                                                                          -
                                                                                                          port?: MessagePort

                                                                                                          Message port.

                                                                                                          -
                                                                                                          priority?: number

                                                                                                          Task priority. Lower values have higher priority.

                                                                                                          +
                                                                                                          checkActive?: boolean

                                                                                                          Whether the worker starts or stops its activity check.

                                                                                                          +
                                                                                                          data?: Data

                                                                                                          Task input data that will be passed to the worker.

                                                                                                          +
                                                                                                          kill?: true | "success" | "HARD" | "SOFT" | "failure"

                                                                                                          Kill code.

                                                                                                          +
                                                                                                          name?: string

                                                                                                          Task name.

                                                                                                          +
                                                                                                          port?: MessagePort

                                                                                                          Message port.

                                                                                                          +
                                                                                                          priority?: number

                                                                                                          Task priority. Lower values have higher priority.

                                                                                                          0
                                                                                                           
                                                                                                          -
                                                                                                          ready?: boolean

                                                                                                          Whether the worker is ready or not.

                                                                                                          -
                                                                                                          statistics?: WorkerStatistics

                                                                                                          Whether the worker computes the given statistics or not.

                                                                                                          -
                                                                                                          strategy?:
                                                                                                              | "FAIR_SHARE"
                                                                                                              | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                              | "LEAST_BUSY"
                                                                                                              | "LEAST_ELU"
                                                                                                              | "LEAST_USED"
                                                                                                              | "ROUND_ROBIN"
                                                                                                              | "WEIGHTED_ROUND_ROBIN"

                                                                                                          Task worker choice strategy.

                                                                                                          -
                                                                                                          taskFunction?: string

                                                                                                          Task function serialized to string.

                                                                                                          -
                                                                                                          taskFunctionOperation?: "add" | "default" | "remove"

                                                                                                          Task function operation:

                                                                                                          +
                                                                                                          ready?: boolean

                                                                                                          Whether the worker is ready or not.

                                                                                                          +
                                                                                                          statistics?: WorkerStatistics

                                                                                                          Whether the worker computes the given statistics or not.

                                                                                                          +
                                                                                                          strategy?:
                                                                                                              | "FAIR_SHARE"
                                                                                                              | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                              | "LEAST_BUSY"
                                                                                                              | "LEAST_ELU"
                                                                                                              | "LEAST_USED"
                                                                                                              | "ROUND_ROBIN"
                                                                                                              | "WEIGHTED_ROUND_ROBIN"

                                                                                                          Task worker choice strategy.

                                                                                                          +
                                                                                                          taskFunction?: string

                                                                                                          Task function serialized to string.

                                                                                                          +
                                                                                                          taskFunctionOperation?: "add" | "default" | "remove"

                                                                                                          Task function operation:

                                                                                                          • 'add' - Add a task function.
                                                                                                          • 'remove' - Remove a task function.
                                                                                                          • 'default' - Set a task function as default.
                                                                                                          -
                                                                                                          taskFunctionOperationStatus?: boolean

                                                                                                          Whether the task function operation is successful or not.

                                                                                                          -
                                                                                                          taskFunctionProperties?: TaskFunctionProperties

                                                                                                          Task function properties.

                                                                                                          -
                                                                                                          taskFunctionsProperties?: TaskFunctionProperties[]

                                                                                                          Task functions properties.

                                                                                                          -
                                                                                                          taskId?: `${string}-${string}-${string}-${string}-${string}`

                                                                                                          Task UUID.

                                                                                                          -
                                                                                                          taskOperation?: "abort"

                                                                                                          Task operation:

                                                                                                          +
                                                                                                          taskFunctionOperationStatus?: boolean

                                                                                                          Whether the task function operation is successful or not.

                                                                                                          +
                                                                                                          taskFunctionProperties?: TaskFunctionProperties

                                                                                                          Task function properties.

                                                                                                          +
                                                                                                          taskFunctionsProperties?: TaskFunctionProperties[]

                                                                                                          Task functions properties.

                                                                                                          +
                                                                                                          taskId?: `${string}-${string}-${string}-${string}-${string}`

                                                                                                          Task UUID.

                                                                                                          +
                                                                                                          taskOperation?: "abort"

                                                                                                          Task operation:

                                                                                                          • 'abort' - Abort a task.
                                                                                                          -
                                                                                                          taskPerformance?: TaskPerformance

                                                                                                          Task performance.

                                                                                                          -
                                                                                                          timestamp?: number

                                                                                                          Timestamp.

                                                                                                          -
                                                                                                          transferList?: readonly Transferable[]

                                                                                                          Array of transferable objects.

                                                                                                          -
                                                                                                          workerError?: WorkerError<ErrorData>

                                                                                                          Worker error.

                                                                                                          -
                                                                                                          workerId?: number

                                                                                                          Worker id.

                                                                                                          -
                                                                                                          +
                                                                                                          taskPerformance?: TaskPerformance

                                                                                                          Task performance.

                                                                                                          +
                                                                                                          timestamp?: number

                                                                                                          Timestamp.

                                                                                                          +
                                                                                                          transferList?: readonly Transferable[]

                                                                                                          Array of transferable objects.

                                                                                                          +
                                                                                                          workerError?: WorkerError<ErrorData>

                                                                                                          Worker error.

                                                                                                          +
                                                                                                          workerId?: number

                                                                                                          Worker id.

                                                                                                          +
                                                                                                          diff --git a/docs/interfaces/src.PoolInfo.html b/docs/interfaces/src.PoolInfo.html index d5b7e39f1..018e524cc 100644 --- a/docs/interfaces/src.PoolInfo.html +++ b/docs/interfaces/src.PoolInfo.html @@ -1,5 +1,5 @@ -PoolInfo | poolifier - v5.1.6
                                                                                                          poolifier - v5.1.6
                                                                                                            Preparing search index...

                                                                                                            Interface PoolInfo

                                                                                                            Pool information.

                                                                                                            -
                                                                                                            interface PoolInfo {
                                                                                                                backPressure?: boolean;
                                                                                                                backPressureWorkerNodes?: number;
                                                                                                                busyWorkerNodes: number;
                                                                                                                defaultStrategy:
                                                                                                                    | "FAIR_SHARE"
                                                                                                                    | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                    | "LEAST_BUSY"
                                                                                                                    | "LEAST_ELU"
                                                                                                                    | "LEAST_USED"
                                                                                                                    | "ROUND_ROBIN"
                                                                                                                    | "WEIGHTED_ROUND_ROBIN";
                                                                                                                dynamicWorkerNodes?: number;
                                                                                                                elu?: {
                                                                                                                    active: {
                                                                                                                        average?: number;
                                                                                                                        maximum: number;
                                                                                                                        median?: number;
                                                                                                                        minimum: number;
                                                                                                                    };
                                                                                                                    idle: {
                                                                                                                        average?: number;
                                                                                                                        maximum: number;
                                                                                                                        median?: number;
                                                                                                                        minimum: number;
                                                                                                                    };
                                                                                                                    utilization: { average?: number; median?: number };
                                                                                                                };
                                                                                                                executedTasks: number;
                                                                                                                executingTasks: number;
                                                                                                                failedTasks: number;
                                                                                                                idleWorkerNodes: number;
                                                                                                                maxQueuedTasks?: number;
                                                                                                                maxSize: number;
                                                                                                                minSize: number;
                                                                                                                queuedTasks?: number;
                                                                                                                ready: boolean;
                                                                                                                runTime?: {
                                                                                                                    average?: number;
                                                                                                                    maximum: number;
                                                                                                                    median?: number;
                                                                                                                    minimum: number;
                                                                                                                };
                                                                                                                started: boolean;
                                                                                                                stealingWorkerNodes?: number;
                                                                                                                stolenTasks?: number;
                                                                                                                strategyRetries: number;
                                                                                                                type: "fixed"
                                                                                                                | "dynamic";
                                                                                                                utilization?: number;
                                                                                                                version: string;
                                                                                                                waitTime?: {
                                                                                                                    average?: number;
                                                                                                                    maximum: number;
                                                                                                                    median?: number;
                                                                                                                    minimum: number;
                                                                                                                };
                                                                                                                worker: "cluster"
                                                                                                                | "thread";
                                                                                                                workerNodes: number;
                                                                                                            }
                                                                                                            Index

                                                                                                            Properties

                                                                                                            backPressure? +PoolInfo | poolifier - v5.1.7
                                                                                                            poolifier - v5.1.7
                                                                                                              Preparing search index...

                                                                                                              Interface PoolInfo

                                                                                                              Pool information.

                                                                                                              +
                                                                                                              interface PoolInfo {
                                                                                                                  backPressure?: boolean;
                                                                                                                  backPressureWorkerNodes?: number;
                                                                                                                  busyWorkerNodes: number;
                                                                                                                  defaultStrategy:
                                                                                                                      | "FAIR_SHARE"
                                                                                                                      | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                      | "LEAST_BUSY"
                                                                                                                      | "LEAST_ELU"
                                                                                                                      | "LEAST_USED"
                                                                                                                      | "ROUND_ROBIN"
                                                                                                                      | "WEIGHTED_ROUND_ROBIN";
                                                                                                                  dynamicWorkerNodes?: number;
                                                                                                                  elu?: {
                                                                                                                      active: {
                                                                                                                          average?: number;
                                                                                                                          maximum: number;
                                                                                                                          median?: number;
                                                                                                                          minimum: number;
                                                                                                                      };
                                                                                                                      idle: {
                                                                                                                          average?: number;
                                                                                                                          maximum: number;
                                                                                                                          median?: number;
                                                                                                                          minimum: number;
                                                                                                                      };
                                                                                                                      utilization: { average?: number; median?: number };
                                                                                                                  };
                                                                                                                  executedTasks: number;
                                                                                                                  executingTasks: number;
                                                                                                                  failedTasks: number;
                                                                                                                  idleWorkerNodes: number;
                                                                                                                  maxQueuedTasks?: number;
                                                                                                                  maxSize: number;
                                                                                                                  minSize: number;
                                                                                                                  queuedTasks?: number;
                                                                                                                  ready: boolean;
                                                                                                                  runTime?: {
                                                                                                                      average?: number;
                                                                                                                      maximum: number;
                                                                                                                      median?: number;
                                                                                                                      minimum: number;
                                                                                                                  };
                                                                                                                  started: boolean;
                                                                                                                  stealingWorkerNodes?: number;
                                                                                                                  stolenTasks?: number;
                                                                                                                  strategyRetries: number;
                                                                                                                  type: "fixed"
                                                                                                                  | "dynamic";
                                                                                                                  utilization?: number;
                                                                                                                  version: string;
                                                                                                                  waitTime?: {
                                                                                                                      average?: number;
                                                                                                                      maximum: number;
                                                                                                                      median?: number;
                                                                                                                      minimum: number;
                                                                                                                  };
                                                                                                                  worker: "cluster"
                                                                                                                  | "thread";
                                                                                                                  workerNodes: number;
                                                                                                              }
                                                                                                              Index

                                                                                                              Properties

                                                                                                              backPressure?: boolean
                                                                                                              backPressureWorkerNodes?: number

                                                                                                              Pool tasks back pressure worker nodes.

                                                                                                              -
                                                                                                              busyWorkerNodes: number

                                                                                                              Pool busy worker nodes.

                                                                                                              -
                                                                                                              defaultStrategy:
                                                                                                                  | "FAIR_SHARE"
                                                                                                                  | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                  | "LEAST_BUSY"
                                                                                                                  | "LEAST_ELU"
                                                                                                                  | "LEAST_USED"
                                                                                                                  | "ROUND_ROBIN"
                                                                                                                  | "WEIGHTED_ROUND_ROBIN"
                                                                                                              dynamicWorkerNodes?: number

                                                                                                              Pool dynamic worker nodes.

                                                                                                              -
                                                                                                              elu?: {
                                                                                                                  active: {
                                                                                                                      average?: number;
                                                                                                                      maximum: number;
                                                                                                                      median?: number;
                                                                                                                      minimum: number;
                                                                                                                  };
                                                                                                                  idle: {
                                                                                                                      average?: number;
                                                                                                                      maximum: number;
                                                                                                                      median?: number;
                                                                                                                      minimum: number;
                                                                                                                  };
                                                                                                                  utilization: { average?: number; median?: number };
                                                                                                              }
                                                                                                              executedTasks: number
                                                                                                              executingTasks: number
                                                                                                              failedTasks: number
                                                                                                              idleWorkerNodes: number

                                                                                                              Pool idle worker nodes.

                                                                                                              -
                                                                                                              maxQueuedTasks?: number
                                                                                                              maxSize: number
                                                                                                              minSize: number
                                                                                                              queuedTasks?: number
                                                                                                              ready: boolean
                                                                                                              runTime?: {
                                                                                                                  average?: number;
                                                                                                                  maximum: number;
                                                                                                                  median?: number;
                                                                                                                  minimum: number;
                                                                                                              }
                                                                                                              started: boolean
                                                                                                              stealingWorkerNodes?: number

                                                                                                              Pool tasks stealing worker nodes.

                                                                                                              -
                                                                                                              stolenTasks?: number
                                                                                                              strategyRetries: number
                                                                                                              type: "fixed" | "dynamic"
                                                                                                              utilization?: number

                                                                                                              Pool utilization.

                                                                                                              -
                                                                                                              version: string
                                                                                                              waitTime?: {
                                                                                                                  average?: number;
                                                                                                                  maximum: number;
                                                                                                                  median?: number;
                                                                                                                  minimum: number;
                                                                                                              }
                                                                                                              worker: "cluster" | "thread"
                                                                                                              workerNodes: number

                                                                                                              Pool total worker nodes.

                                                                                                              -
                                                                                                              +

                                                                                                              Properties

                                                                                                              backPressure?: boolean
                                                                                                              backPressureWorkerNodes?: number

                                                                                                              Pool tasks back pressure worker nodes.

                                                                                                              +
                                                                                                              busyWorkerNodes: number

                                                                                                              Pool busy worker nodes.

                                                                                                              +
                                                                                                              defaultStrategy:
                                                                                                                  | "FAIR_SHARE"
                                                                                                                  | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                  | "LEAST_BUSY"
                                                                                                                  | "LEAST_ELU"
                                                                                                                  | "LEAST_USED"
                                                                                                                  | "ROUND_ROBIN"
                                                                                                                  | "WEIGHTED_ROUND_ROBIN"
                                                                                                              dynamicWorkerNodes?: number

                                                                                                              Pool dynamic worker nodes.

                                                                                                              +
                                                                                                              elu?: {
                                                                                                                  active: {
                                                                                                                      average?: number;
                                                                                                                      maximum: number;
                                                                                                                      median?: number;
                                                                                                                      minimum: number;
                                                                                                                  };
                                                                                                                  idle: {
                                                                                                                      average?: number;
                                                                                                                      maximum: number;
                                                                                                                      median?: number;
                                                                                                                      minimum: number;
                                                                                                                  };
                                                                                                                  utilization: { average?: number; median?: number };
                                                                                                              }
                                                                                                              executedTasks: number
                                                                                                              executingTasks: number
                                                                                                              failedTasks: number
                                                                                                              idleWorkerNodes: number

                                                                                                              Pool idle worker nodes.

                                                                                                              +
                                                                                                              maxQueuedTasks?: number
                                                                                                              maxSize: number
                                                                                                              minSize: number
                                                                                                              queuedTasks?: number
                                                                                                              ready: boolean
                                                                                                              runTime?: {
                                                                                                                  average?: number;
                                                                                                                  maximum: number;
                                                                                                                  median?: number;
                                                                                                                  minimum: number;
                                                                                                              }
                                                                                                              started: boolean
                                                                                                              stealingWorkerNodes?: number

                                                                                                              Pool tasks stealing worker nodes.

                                                                                                              +
                                                                                                              stolenTasks?: number
                                                                                                              strategyRetries: number
                                                                                                              type: "fixed" | "dynamic"
                                                                                                              utilization?: number

                                                                                                              Pool utilization.

                                                                                                              +
                                                                                                              version: string
                                                                                                              waitTime?: {
                                                                                                                  average?: number;
                                                                                                                  maximum: number;
                                                                                                                  median?: number;
                                                                                                                  minimum: number;
                                                                                                              }
                                                                                                              worker: "cluster" | "thread"
                                                                                                              workerNodes: number

                                                                                                              Pool total worker nodes.

                                                                                                              +
                                                                                                              diff --git a/docs/interfaces/src.PoolOptions.html b/docs/interfaces/src.PoolOptions.html index 124fb4cdb..9b03273f8 100644 --- a/docs/interfaces/src.PoolOptions.html +++ b/docs/interfaces/src.PoolOptions.html @@ -1,6 +1,6 @@ -PoolOptions | poolifier - v5.1.6
                                                                                                              poolifier - v5.1.6
                                                                                                                Preparing search index...

                                                                                                                Interface PoolOptions<Worker>

                                                                                                                Options for a poolifier pool.

                                                                                                                -
                                                                                                                interface PoolOptions<Worker extends IWorker> {
                                                                                                                    enableEvents?: boolean;
                                                                                                                    enableTasksQueue?: boolean;
                                                                                                                    env?: Record<string, unknown>;
                                                                                                                    errorHandler?: ErrorHandler<Worker>;
                                                                                                                    exitHandler?: ExitHandler<Worker>;
                                                                                                                    messageHandler?: MessageHandler<Worker>;
                                                                                                                    onlineHandler?: OnlineHandler<Worker>;
                                                                                                                    restartWorkerOnError?: boolean;
                                                                                                                    settings?: ClusterSettings;
                                                                                                                    startWorkers?: boolean;
                                                                                                                    tasksQueueOptions?: TasksQueueOptions;
                                                                                                                    workerChoiceStrategy?:
                                                                                                                        | "FAIR_SHARE"
                                                                                                                        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                        | "LEAST_BUSY"
                                                                                                                        | "LEAST_ELU"
                                                                                                                        | "LEAST_USED"
                                                                                                                        | "ROUND_ROBIN"
                                                                                                                        | "WEIGHTED_ROUND_ROBIN";
                                                                                                                    workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions;
                                                                                                                    workerOptions?: WorkerOptions;
                                                                                                                }

                                                                                                                Type Parameters

                                                                                                                • Worker extends IWorker

                                                                                                                  Type of worker.

                                                                                                                  -
                                                                                                                Index

                                                                                                                Properties

                                                                                                                enableEvents? +PoolOptions | poolifier - v5.1.7
                                                                                                                poolifier - v5.1.7
                                                                                                                  Preparing search index...

                                                                                                                  Interface PoolOptions<Worker>

                                                                                                                  Options for a poolifier pool.

                                                                                                                  +
                                                                                                                  interface PoolOptions<Worker extends IWorker> {
                                                                                                                      enableEvents?: boolean;
                                                                                                                      enableTasksQueue?: boolean;
                                                                                                                      env?: Record<string, unknown>;
                                                                                                                      errorHandler?: ErrorHandler<Worker>;
                                                                                                                      exitHandler?: ExitHandler<Worker>;
                                                                                                                      messageHandler?: MessageHandler<Worker>;
                                                                                                                      onlineHandler?: OnlineHandler<Worker>;
                                                                                                                      restartWorkerOnError?: boolean;
                                                                                                                      settings?: ClusterSettings;
                                                                                                                      startWorkers?: boolean;
                                                                                                                      tasksQueueOptions?: TasksQueueOptions;
                                                                                                                      workerChoiceStrategy?:
                                                                                                                          | "FAIR_SHARE"
                                                                                                                          | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                          | "LEAST_BUSY"
                                                                                                                          | "LEAST_ELU"
                                                                                                                          | "LEAST_USED"
                                                                                                                          | "ROUND_ROBIN"
                                                                                                                          | "WEIGHTED_ROUND_ROBIN";
                                                                                                                      workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions;
                                                                                                                      workerOptions?: WorkerOptions;
                                                                                                                  }

                                                                                                                  Type Parameters

                                                                                                                  • Worker extends IWorker

                                                                                                                    Type of worker.

                                                                                                                    +
                                                                                                                  Index

                                                                                                                  Properties

                                                                                                                  true
                                                                                                                   
                                                                                                                  -
                                                                                                                  enableTasksQueue?: boolean

                                                                                                                  Pool worker node tasks queue.

                                                                                                                  +
                                                                                                                  enableTasksQueue?: boolean

                                                                                                                  Pool worker node tasks queue.

                                                                                                                  false
                                                                                                                   
                                                                                                                  -
                                                                                                                  env?: Record<string, unknown>

                                                                                                                  Key/value pairs to add to worker process environment.

                                                                                                                  +
                                                                                                                  env?: Record<string, unknown>

                                                                                                                  Key/value pairs to add to worker process environment.

                                                                                                                  errorHandler?: ErrorHandler<Worker>

                                                                                                                  A function that will listen for error event on each worker.

                                                                                                                  +
                                                                                                                  errorHandler?: ErrorHandler<Worker>

                                                                                                                  A function that will listen for error event on each worker.

                                                                                                                  () => {}

                                                                                                                  -
                                                                                                                  exitHandler?: ExitHandler<Worker>

                                                                                                                  A function that will listen for exit event on each worker.

                                                                                                                  +
                                                                                                                  exitHandler?: ExitHandler<Worker>

                                                                                                                  A function that will listen for exit event on each worker.

                                                                                                                  () => {}

                                                                                                                  -
                                                                                                                  messageHandler?: MessageHandler<Worker>

                                                                                                                  A function that will listen for message event on each worker.

                                                                                                                  +
                                                                                                                  messageHandler?: MessageHandler<Worker>

                                                                                                                  A function that will listen for message event on each worker.

                                                                                                                  () => {}

                                                                                                                  -
                                                                                                                  onlineHandler?: OnlineHandler<Worker>

                                                                                                                  A function that will listen for online event on each worker.

                                                                                                                  +
                                                                                                                  onlineHandler?: OnlineHandler<Worker>

                                                                                                                  A function that will listen for online event on each worker.

                                                                                                                  () => {}

                                                                                                                  -
                                                                                                                  restartWorkerOnError?: boolean

                                                                                                                  Restart worker on error.

                                                                                                                  -
                                                                                                                  settings?: ClusterSettings

                                                                                                                  Cluster settings.

                                                                                                                  +
                                                                                                                  restartWorkerOnError?: boolean

                                                                                                                  Restart worker on error.

                                                                                                                  +
                                                                                                                  settings?: ClusterSettings

                                                                                                                  Cluster settings.

                                                                                                                  startWorkers?: boolean

                                                                                                                  Whether to start the minimum number of workers at pool initialization.

                                                                                                                  +
                                                                                                                  startWorkers?: boolean

                                                                                                                  Whether to start the minimum number of workers at pool initialization.

                                                                                                                  true
                                                                                                                   
                                                                                                                  -
                                                                                                                  tasksQueueOptions?: TasksQueueOptions

                                                                                                                  Pool worker node tasks queue options.

                                                                                                                  -
                                                                                                                  workerChoiceStrategy?:
                                                                                                                      | "FAIR_SHARE"
                                                                                                                      | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                      | "LEAST_BUSY"
                                                                                                                      | "LEAST_ELU"
                                                                                                                      | "LEAST_USED"
                                                                                                                      | "ROUND_ROBIN"
                                                                                                                      | "WEIGHTED_ROUND_ROBIN"

                                                                                                                  The default worker choice strategy to use in this pool.

                                                                                                                  -
                                                                                                                  WorkerChoiceStrategies.ROUND_ROBIN
                                                                                                                  +
                                                                                                                  tasksQueueOptions?: TasksQueueOptions

                                                                                                                  Pool worker node tasks queue options.

                                                                                                                  +
                                                                                                                  workerChoiceStrategy?:
                                                                                                                      | "FAIR_SHARE"
                                                                                                                      | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                      | "LEAST_BUSY"
                                                                                                                      | "LEAST_ELU"
                                                                                                                      | "LEAST_USED"
                                                                                                                      | "ROUND_ROBIN"
                                                                                                                      | "WEIGHTED_ROUND_ROBIN"

                                                                                                                  The default worker choice strategy to use in this pool.

                                                                                                                  +
                                                                                                                  WorkerChoiceStrategies.LEAST_USED
                                                                                                                   
                                                                                                                  -
                                                                                                                  workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions

                                                                                                                  The worker choice strategy options.

                                                                                                                  -
                                                                                                                  workerOptions?: WorkerOptions

                                                                                                                  Worker options.

                                                                                                                  +
                                                                                                                  workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions

                                                                                                                  The worker choice strategy options.

                                                                                                                  +
                                                                                                                  workerOptions?: WorkerOptions

                                                                                                                  Worker options.

                                                                                                                  +
                                                                                                                  diff --git a/docs/interfaces/src.PriorityQueue.html b/docs/interfaces/src.PriorityQueue.html index adb072af4..6b954640d 100644 --- a/docs/interfaces/src.PriorityQueue.html +++ b/docs/interfaces/src.PriorityQueue.html @@ -1,6 +1,6 @@ -PriorityQueue | poolifier - v5.1.6
                                                                                                                  poolifier - v5.1.6
                                                                                                                    Preparing search index...

                                                                                                                    Interface PriorityQueue<T>Internal

                                                                                                                    Priority queue.

                                                                                                                    -
                                                                                                                    interface PriorityQueue<T> {
                                                                                                                        maxSize: number;
                                                                                                                        size: number;
                                                                                                                        get buckets(): number;
                                                                                                                        get enablePriority(): boolean;
                                                                                                                        set enablePriority(enablePriority: boolean): void;
                                                                                                                        "[iterator]"(): Iterator<T>;
                                                                                                                        clear(): void;
                                                                                                                        delete(data: T): boolean;
                                                                                                                        dequeue(bucket?: number): undefined | T;
                                                                                                                        enqueue(data: T, priority?: number): number;
                                                                                                                    }

                                                                                                                    Type Parameters

                                                                                                                    • T

                                                                                                                      Type of priority queue data.

                                                                                                                      -
                                                                                                                    Index

                                                                                                                    Properties

                                                                                                                    maxSize +PriorityQueue | poolifier - v5.1.7
                                                                                                                    poolifier - v5.1.7
                                                                                                                      Preparing search index...

                                                                                                                      Interface PriorityQueue<T>Internal

                                                                                                                      Priority queue.

                                                                                                                      +
                                                                                                                      interface PriorityQueue<T> {
                                                                                                                          maxSize: number;
                                                                                                                          size: number;
                                                                                                                          get buckets(): number;
                                                                                                                          get enablePriority(): boolean;
                                                                                                                          set enablePriority(enablePriority: boolean): void;
                                                                                                                          "[iterator]"(): Iterator<T>;
                                                                                                                          clear(): void;
                                                                                                                          delete(data: T): boolean;
                                                                                                                          dequeue(bucket?: number): T | undefined;
                                                                                                                          enqueue(data: T, priority?: number): number;
                                                                                                                      }

                                                                                                                      Type Parameters

                                                                                                                      • T

                                                                                                                        Type of priority queue data.

                                                                                                                        +
                                                                                                                      Index

                                                                                                                      Properties

                                                                                                                      Accessors

                                                                                                                      buckets enablePriority @@ -10,25 +10,25 @@ dequeue enqueue

                                                                                                                      Properties

                                                                                                                      maxSize: number

                                                                                                                      The priority queue maximum size.

                                                                                                                      -
                                                                                                                      size: number

                                                                                                                      The priority queue size.

                                                                                                                      -

                                                                                                                      Accessors

                                                                                                                      size: number

                                                                                                                      The priority queue size.

                                                                                                                      +

                                                                                                                      Accessors

                                                                                                                      • get buckets(): number

                                                                                                                        The number of filled prioritized buckets.

                                                                                                                        Returns number

                                                                                                                        The number of filled prioritized buckets.

                                                                                                                        -

                                                                                                                      Methods

                                                                                                                      • Returns an iterator for the priority queue.

                                                                                                                        +

                                                                                                                      Returns void

                                                                                                                      Methods

                                                                                                                      • Deletes the given data from the priority queue.

                                                                                                                        Parameters

                                                                                                                        • data: T

                                                                                                                          Data to delete.

                                                                                                                          -

                                                                                                                        Returns boolean

                                                                                                                        true if the data was deleted, false otherwise.

                                                                                                                        -
                                                                                                                      • Dequeue data from the priority queue.

                                                                                                                        +

                                                                                                                      Returns boolean

                                                                                                                      true if the data was deleted, false otherwise.

                                                                                                                      +
                                                                                                                      • Dequeue data from the priority queue.

                                                                                                                        Parameters

                                                                                                                        • Optionalbucket: number

                                                                                                                          The prioritized bucket to dequeue from.

                                                                                                                          -

                                                                                                                        Returns undefined | T

                                                                                                                        The dequeued data or undefined if the priority queue is empty.

                                                                                                                        -
                                                                                                                      • Enqueue data into the priority queue.

                                                                                                                        +

                                                                                                                      Returns T | undefined

                                                                                                                      The dequeued data or undefined if the priority queue is empty.

                                                                                                                      +
                                                                                                                      • Enqueue data into the priority queue.

                                                                                                                        Parameters

                                                                                                                        • data: T

                                                                                                                          Data to enqueue.

                                                                                                                          -
                                                                                                                        • Optionalpriority: number

                                                                                                                          Priority of the data. Lower values have higher priority.

                                                                                                                          -

                                                                                                                        Returns number

                                                                                                                        The new size of the priority queue.

                                                                                                                        -
                                                                                                                      +
                                                                                                                    • Optionalpriority: number

                                                                                                                      Priority of the data. Lower values have higher priority.

                                                                                                                      +
                                                                                                                    • Returns number

                                                                                                                      The new size of the priority queue.

                                                                                                                      +
                                                                                                                      diff --git a/docs/interfaces/src.PromiseResponseWrapper.html b/docs/interfaces/src.PromiseResponseWrapper.html index 6cb100d5a..e4309f68b 100644 --- a/docs/interfaces/src.PromiseResponseWrapper.html +++ b/docs/interfaces/src.PromiseResponseWrapper.html @@ -1,13 +1,13 @@ -PromiseResponseWrapper | poolifier - v5.1.6
                                                                                                                      poolifier - v5.1.6
                                                                                                                        Preparing search index...

                                                                                                                        Interface PromiseResponseWrapper<Response>Internal

                                                                                                                        An object holding the task execution response promise resolve/reject callbacks.

                                                                                                                        -
                                                                                                                        interface PromiseResponseWrapper<Response = unknown> {
                                                                                                                            abortSignal?: AbortSignal;
                                                                                                                            asyncResource?: AsyncResource;
                                                                                                                            reject: (reason?: unknown) => void;
                                                                                                                            resolve: (value: Response | PromiseLike<Response>) => void;
                                                                                                                            workerNodeKey: number;
                                                                                                                        }

                                                                                                                        Type Parameters

                                                                                                                        • Response = unknown

                                                                                                                          Type of execution response. This can only be structured-cloneable data.

                                                                                                                          -
                                                                                                                        Index

                                                                                                                        Properties

                                                                                                                        abortSignal? +PromiseResponseWrapper | poolifier - v5.1.7
                                                                                                                        poolifier - v5.1.7
                                                                                                                          Preparing search index...

                                                                                                                          Interface PromiseResponseWrapper<Response>Internal

                                                                                                                          An object holding the task execution response promise resolve/reject callbacks.

                                                                                                                          +
                                                                                                                          interface PromiseResponseWrapper<Response = unknown> {
                                                                                                                              abortSignal?: AbortSignal;
                                                                                                                              asyncResource?: AsyncResource;
                                                                                                                              reject: (reason?: unknown) => void;
                                                                                                                              resolve: (value: Response | PromiseLike<Response>) => void;
                                                                                                                              workerNodeKey: number;
                                                                                                                          }

                                                                                                                          Type Parameters

                                                                                                                          • Response = unknown

                                                                                                                            Type of execution response. This can only be structured-cloneable data.

                                                                                                                            +
                                                                                                                          Index

                                                                                                                          Properties

                                                                                                                          abortSignal?: AbortSignal

                                                                                                                          The task abort signal.

                                                                                                                          -
                                                                                                                          asyncResource?: AsyncResource

                                                                                                                          The asynchronous resource used to track the task execution.

                                                                                                                          -
                                                                                                                          reject: (reason?: unknown) => void

                                                                                                                          Reject callback to reject the promise.

                                                                                                                          -
                                                                                                                          resolve: (value: Response | PromiseLike<Response>) => void

                                                                                                                          Resolve callback to fulfill the promise.

                                                                                                                          -
                                                                                                                          workerNodeKey: number

                                                                                                                          The worker node key executing the task.

                                                                                                                          -
                                                                                                                          +
                                                                                                                          asyncResource?: AsyncResource

                                                                                                                          The asynchronous resource used to track the task execution.

                                                                                                                          +
                                                                                                                          reject: (reason?: unknown) => void

                                                                                                                          Reject callback to reject the promise.

                                                                                                                          +
                                                                                                                          resolve: (value: Response | PromiseLike<Response>) => void

                                                                                                                          Resolve callback to fulfill the promise.

                                                                                                                          +
                                                                                                                          workerNodeKey: number

                                                                                                                          The worker node key executing the task.

                                                                                                                          +
                                                                                                                          diff --git a/docs/interfaces/src.StrategyData.html b/docs/interfaces/src.StrategyData.html index e53365434..536ca868a 100644 --- a/docs/interfaces/src.StrategyData.html +++ b/docs/interfaces/src.StrategyData.html @@ -1,3 +1,3 @@ -StrategyData | poolifier - v5.1.6
                                                                                                                          poolifier - v5.1.6
                                                                                                                            Preparing search index...

                                                                                                                            Interface StrategyDataInternal

                                                                                                                            Worker choice strategy data.

                                                                                                                            -
                                                                                                                            interface StrategyData {
                                                                                                                                virtualTaskEndTimestamp?: number;
                                                                                                                            }
                                                                                                                            Index

                                                                                                                            Properties

                                                                                                                            virtualTaskEndTimestamp?: number
                                                                                                                            +StrategyData | poolifier - v5.1.7
                                                                                                                            poolifier - v5.1.7
                                                                                                                              Preparing search index...

                                                                                                                              Interface StrategyDataInternal

                                                                                                                              Worker choice strategy data.

                                                                                                                              +
                                                                                                                              interface StrategyData {
                                                                                                                                  virtualTaskEndTimestamp?: number;
                                                                                                                              }
                                                                                                                              Index

                                                                                                                              Properties

                                                                                                                              virtualTaskEndTimestamp?: number
                                                                                                                              diff --git a/docs/interfaces/src.StrategyPolicy.html b/docs/interfaces/src.StrategyPolicy.html index b3754d7e5..a163cb5d2 100644 --- a/docs/interfaces/src.StrategyPolicy.html +++ b/docs/interfaces/src.StrategyPolicy.html @@ -1,6 +1,6 @@ -StrategyPolicy | poolifier - v5.1.6
                                                                                                                              poolifier - v5.1.6
                                                                                                                                Preparing search index...

                                                                                                                                Interface StrategyPolicyInternal

                                                                                                                                Strategy policy.

                                                                                                                                -
                                                                                                                                interface StrategyPolicy {
                                                                                                                                    dynamicWorkerReady: boolean;
                                                                                                                                    dynamicWorkerUsage: boolean;
                                                                                                                                }
                                                                                                                                Index

                                                                                                                                Properties

                                                                                                                                dynamicWorkerReady +StrategyPolicy | poolifier - v5.1.7
                                                                                                                                poolifier - v5.1.7
                                                                                                                                  Preparing search index...

                                                                                                                                  Interface StrategyPolicyInternal

                                                                                                                                  Strategy policy.

                                                                                                                                  +
                                                                                                                                  interface StrategyPolicy {
                                                                                                                                      dynamicWorkerReady: boolean;
                                                                                                                                      dynamicWorkerUsage: boolean;
                                                                                                                                  }
                                                                                                                                  Index

                                                                                                                                  Properties

                                                                                                                                  dynamicWorkerReady: boolean

                                                                                                                                  Expects the newly created dynamic worker to be flagged as ready.

                                                                                                                                  -
                                                                                                                                  dynamicWorkerUsage: boolean

                                                                                                                                  Expects tasks execution on the newly created dynamic worker.

                                                                                                                                  -
                                                                                                                                  +
                                                                                                                                  dynamicWorkerUsage: boolean

                                                                                                                                  Expects tasks execution on the newly created dynamic worker.

                                                                                                                                  +
                                                                                                                                  diff --git a/docs/interfaces/src.Task.html b/docs/interfaces/src.Task.html index af1990f04..f77ee8fa6 100644 --- a/docs/interfaces/src.Task.html +++ b/docs/interfaces/src.Task.html @@ -1,6 +1,6 @@ -Task | poolifier - v5.1.6
                                                                                                                                  poolifier - v5.1.6
                                                                                                                                    Preparing search index...

                                                                                                                                    Interface Task<Data>Internal

                                                                                                                                    Message object that is passed as a task between main worker and worker.

                                                                                                                                    -
                                                                                                                                    interface Task<Data = unknown> {
                                                                                                                                        abortable?: boolean;
                                                                                                                                        data?: Data;
                                                                                                                                        name?: string;
                                                                                                                                        priority?: number;
                                                                                                                                        strategy?:
                                                                                                                                            | "FAIR_SHARE"
                                                                                                                                            | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                            | "LEAST_BUSY"
                                                                                                                                            | "LEAST_ELU"
                                                                                                                                            | "LEAST_USED"
                                                                                                                                            | "ROUND_ROBIN"
                                                                                                                                            | "WEIGHTED_ROUND_ROBIN";
                                                                                                                                        taskId?: `${string}-${string}-${string}-${string}-${string}`;
                                                                                                                                        timestamp?: number;
                                                                                                                                        transferList?: readonly Transferable[];
                                                                                                                                    }

                                                                                                                                    Type Parameters

                                                                                                                                    • Data = unknown

                                                                                                                                      Type of data sent to the worker. This can only be structured-cloneable data.

                                                                                                                                      -

                                                                                                                                    Hierarchy (View Summary)

                                                                                                                                    Index

                                                                                                                                    Properties

                                                                                                                                    abortable? +Task | poolifier - v5.1.7
                                                                                                                                    poolifier - v5.1.7
                                                                                                                                      Preparing search index...

                                                                                                                                      Interface Task<Data>Internal

                                                                                                                                      Message object that is passed as a task between main worker and worker.

                                                                                                                                      +
                                                                                                                                      interface Task<Data = unknown> {
                                                                                                                                          abortable?: boolean;
                                                                                                                                          data?: Data;
                                                                                                                                          name?: string;
                                                                                                                                          priority?: number;
                                                                                                                                          strategy?:
                                                                                                                                              | "FAIR_SHARE"
                                                                                                                                              | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                              | "LEAST_BUSY"
                                                                                                                                              | "LEAST_ELU"
                                                                                                                                              | "LEAST_USED"
                                                                                                                                              | "ROUND_ROBIN"
                                                                                                                                              | "WEIGHTED_ROUND_ROBIN";
                                                                                                                                          taskId?: `${string}-${string}-${string}-${string}-${string}`;
                                                                                                                                          timestamp?: number;
                                                                                                                                          transferList?: readonly Transferable[];
                                                                                                                                      }

                                                                                                                                      Type Parameters

                                                                                                                                      • Data = unknown

                                                                                                                                        Type of data sent to the worker. This can only be structured-cloneable data.

                                                                                                                                        +

                                                                                                                                      Hierarchy (View Summary)

                                                                                                                                      Index

                                                                                                                                      Properties

                                                                                                                                      abortable?: boolean

                                                                                                                                      Whether the task is abortable or not.

                                                                                                                                      -
                                                                                                                                      data?: Data

                                                                                                                                      Task input data that will be passed to the worker.

                                                                                                                                      -
                                                                                                                                      name?: string

                                                                                                                                      Task name.

                                                                                                                                      -
                                                                                                                                      priority?: number

                                                                                                                                      Task priority. Lower values have higher priority.

                                                                                                                                      +
                                                                                                                                      data?: Data

                                                                                                                                      Task input data that will be passed to the worker.

                                                                                                                                      +
                                                                                                                                      name?: string

                                                                                                                                      Task name.

                                                                                                                                      +
                                                                                                                                      priority?: number

                                                                                                                                      Task priority. Lower values have higher priority.

                                                                                                                                      0
                                                                                                                                       
                                                                                                                                      -
                                                                                                                                      strategy?:
                                                                                                                                          | "FAIR_SHARE"
                                                                                                                                          | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                          | "LEAST_BUSY"
                                                                                                                                          | "LEAST_ELU"
                                                                                                                                          | "LEAST_USED"
                                                                                                                                          | "ROUND_ROBIN"
                                                                                                                                          | "WEIGHTED_ROUND_ROBIN"

                                                                                                                                      Task worker choice strategy.

                                                                                                                                      -
                                                                                                                                      taskId?: `${string}-${string}-${string}-${string}-${string}`

                                                                                                                                      Task UUID.

                                                                                                                                      -
                                                                                                                                      timestamp?: number

                                                                                                                                      Timestamp.

                                                                                                                                      -
                                                                                                                                      transferList?: readonly Transferable[]

                                                                                                                                      Array of transferable objects.

                                                                                                                                      -
                                                                                                                                      +
                                                                                                                                      strategy?:
                                                                                                                                          | "FAIR_SHARE"
                                                                                                                                          | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                          | "LEAST_BUSY"
                                                                                                                                          | "LEAST_ELU"
                                                                                                                                          | "LEAST_USED"
                                                                                                                                          | "ROUND_ROBIN"
                                                                                                                                          | "WEIGHTED_ROUND_ROBIN"

                                                                                                                                      Task worker choice strategy.

                                                                                                                                      +
                                                                                                                                      taskId?: `${string}-${string}-${string}-${string}-${string}`

                                                                                                                                      Task UUID.

                                                                                                                                      +
                                                                                                                                      timestamp?: number

                                                                                                                                      Timestamp.

                                                                                                                                      +
                                                                                                                                      transferList?: readonly Transferable[]

                                                                                                                                      Array of transferable objects.

                                                                                                                                      +
                                                                                                                                      diff --git a/docs/interfaces/src.TaskFunctionObject.html b/docs/interfaces/src.TaskFunctionObject.html index 456336d9c..ad0a876eb 100644 --- a/docs/interfaces/src.TaskFunctionObject.html +++ b/docs/interfaces/src.TaskFunctionObject.html @@ -1,10 +1,10 @@ -TaskFunctionObject | poolifier - v5.1.6
                                                                                                                                      poolifier - v5.1.6
                                                                                                                                        Preparing search index...

                                                                                                                                        Interface TaskFunctionObject<Data, Response>

                                                                                                                                        Task function object.

                                                                                                                                        -
                                                                                                                                        interface TaskFunctionObject<Data = unknown, Response = unknown> {
                                                                                                                                            priority?: number;
                                                                                                                                            strategy?:
                                                                                                                                                | "FAIR_SHARE"
                                                                                                                                                | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                | "LEAST_BUSY"
                                                                                                                                                | "LEAST_ELU"
                                                                                                                                                | "LEAST_USED"
                                                                                                                                                | "ROUND_ROBIN"
                                                                                                                                                | "WEIGHTED_ROUND_ROBIN";
                                                                                                                                            taskFunction: TaskFunction<Data, Response>;
                                                                                                                                        }

                                                                                                                                        Type Parameters

                                                                                                                                        • Data = unknown

                                                                                                                                          Type of data sent to the worker. This can only be structured-cloneable data.

                                                                                                                                          -
                                                                                                                                        • Response = unknown

                                                                                                                                          Type of execution response. This can only be structured-cloneable data.

                                                                                                                                          -
                                                                                                                                        Index

                                                                                                                                        Properties

                                                                                                                                        priority? +TaskFunctionObject | poolifier - v5.1.7
                                                                                                                                        poolifier - v5.1.7
                                                                                                                                          Preparing search index...

                                                                                                                                          Interface TaskFunctionObject<Data, Response>

                                                                                                                                          Task function object.

                                                                                                                                          +
                                                                                                                                          interface TaskFunctionObject<Data = unknown, Response = unknown> {
                                                                                                                                              priority?: number;
                                                                                                                                              strategy?:
                                                                                                                                                  | "FAIR_SHARE"
                                                                                                                                                  | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                  | "LEAST_BUSY"
                                                                                                                                                  | "LEAST_ELU"
                                                                                                                                                  | "LEAST_USED"
                                                                                                                                                  | "ROUND_ROBIN"
                                                                                                                                                  | "WEIGHTED_ROUND_ROBIN";
                                                                                                                                              taskFunction: TaskFunction<Data, Response>;
                                                                                                                                          }

                                                                                                                                          Type Parameters

                                                                                                                                          • Data = unknown

                                                                                                                                            Type of data sent to the worker. This can only be structured-cloneable data.

                                                                                                                                            +
                                                                                                                                          • Response = unknown

                                                                                                                                            Type of execution response. This can only be structured-cloneable data.

                                                                                                                                            +
                                                                                                                                          Index

                                                                                                                                          Properties

                                                                                                                                          priority?: number

                                                                                                                                          Task function priority. Lower values have higher priority.

                                                                                                                                          -
                                                                                                                                          strategy?:
                                                                                                                                              | "FAIR_SHARE"
                                                                                                                                              | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                              | "LEAST_BUSY"
                                                                                                                                              | "LEAST_ELU"
                                                                                                                                              | "LEAST_USED"
                                                                                                                                              | "ROUND_ROBIN"
                                                                                                                                              | "WEIGHTED_ROUND_ROBIN"

                                                                                                                                          Task function worker choice strategy.

                                                                                                                                          -
                                                                                                                                          taskFunction: TaskFunction<Data, Response>

                                                                                                                                          Task function.

                                                                                                                                          -
                                                                                                                                          +
                                                                                                                                          strategy?:
                                                                                                                                              | "FAIR_SHARE"
                                                                                                                                              | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                              | "LEAST_BUSY"
                                                                                                                                              | "LEAST_ELU"
                                                                                                                                              | "LEAST_USED"
                                                                                                                                              | "ROUND_ROBIN"
                                                                                                                                              | "WEIGHTED_ROUND_ROBIN"

                                                                                                                                          Task function worker choice strategy.

                                                                                                                                          +
                                                                                                                                          taskFunction: TaskFunction<Data, Response>

                                                                                                                                          Task function.

                                                                                                                                          +
                                                                                                                                          diff --git a/docs/interfaces/src.TaskFunctionOperationResult.html b/docs/interfaces/src.TaskFunctionOperationResult.html index dbd2244c4..59f525b9c 100644 --- a/docs/interfaces/src.TaskFunctionOperationResult.html +++ b/docs/interfaces/src.TaskFunctionOperationResult.html @@ -1,4 +1,4 @@ -TaskFunctionOperationResult | poolifier - v5.1.6
                                                                                                                                          poolifier - v5.1.6
                                                                                                                                            Preparing search index...

                                                                                                                                            Interface TaskFunctionOperationResult

                                                                                                                                            Task function operation result.

                                                                                                                                            -
                                                                                                                                            interface TaskFunctionOperationResult {
                                                                                                                                                error?: Error;
                                                                                                                                                status: boolean;
                                                                                                                                            }
                                                                                                                                            Index

                                                                                                                                            Properties

                                                                                                                                            error? +TaskFunctionOperationResult | poolifier - v5.1.7
                                                                                                                                            poolifier - v5.1.7
                                                                                                                                              Preparing search index...

                                                                                                                                              Interface TaskFunctionOperationResult

                                                                                                                                              Task function operation result.

                                                                                                                                              +
                                                                                                                                              interface TaskFunctionOperationResult {
                                                                                                                                                  error?: Error;
                                                                                                                                                  status: boolean;
                                                                                                                                              }
                                                                                                                                              Index

                                                                                                                                              Properties

                                                                                                                                              Properties

                                                                                                                                              error?: Error
                                                                                                                                              status: boolean
                                                                                                                                              +

                                                                                                                                              Properties

                                                                                                                                              error?: Error
                                                                                                                                              status: boolean
                                                                                                                                              diff --git a/docs/interfaces/src.TaskFunctionProperties.html b/docs/interfaces/src.TaskFunctionProperties.html index 66fdcfcba..eae0b65e1 100644 --- a/docs/interfaces/src.TaskFunctionProperties.html +++ b/docs/interfaces/src.TaskFunctionProperties.html @@ -1,8 +1,8 @@ -TaskFunctionProperties | poolifier - v5.1.6
                                                                                                                                              poolifier - v5.1.6
                                                                                                                                                Preparing search index...

                                                                                                                                                Interface TaskFunctionProperties

                                                                                                                                                Task function properties.

                                                                                                                                                -
                                                                                                                                                interface TaskFunctionProperties {
                                                                                                                                                    name: string;
                                                                                                                                                    priority?: number;
                                                                                                                                                    strategy?:
                                                                                                                                                        | "FAIR_SHARE"
                                                                                                                                                        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                        | "LEAST_BUSY"
                                                                                                                                                        | "LEAST_ELU"
                                                                                                                                                        | "LEAST_USED"
                                                                                                                                                        | "ROUND_ROBIN"
                                                                                                                                                        | "WEIGHTED_ROUND_ROBIN";
                                                                                                                                                }
                                                                                                                                                Index

                                                                                                                                                Properties

                                                                                                                                                name +TaskFunctionProperties | poolifier - v5.1.7
                                                                                                                                                poolifier - v5.1.7
                                                                                                                                                  Preparing search index...

                                                                                                                                                  Interface TaskFunctionProperties

                                                                                                                                                  Task function properties.

                                                                                                                                                  +
                                                                                                                                                  interface TaskFunctionProperties {
                                                                                                                                                      name: string;
                                                                                                                                                      priority?: number;
                                                                                                                                                      strategy?:
                                                                                                                                                          | "FAIR_SHARE"
                                                                                                                                                          | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                          | "LEAST_BUSY"
                                                                                                                                                          | "LEAST_ELU"
                                                                                                                                                          | "LEAST_USED"
                                                                                                                                                          | "ROUND_ROBIN"
                                                                                                                                                          | "WEIGHTED_ROUND_ROBIN";
                                                                                                                                                  }
                                                                                                                                                  Index

                                                                                                                                                  Properties

                                                                                                                                                  name: string

                                                                                                                                                  Task function name.

                                                                                                                                                  -
                                                                                                                                                  priority?: number

                                                                                                                                                  Task function priority. Lower values have higher priority.

                                                                                                                                                  -
                                                                                                                                                  strategy?:
                                                                                                                                                      | "FAIR_SHARE"
                                                                                                                                                      | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                      | "LEAST_BUSY"
                                                                                                                                                      | "LEAST_ELU"
                                                                                                                                                      | "LEAST_USED"
                                                                                                                                                      | "ROUND_ROBIN"
                                                                                                                                                      | "WEIGHTED_ROUND_ROBIN"

                                                                                                                                                  Task function worker choice strategy.

                                                                                                                                                  -
                                                                                                                                                  +
                                                                                                                                                  priority?: number

                                                                                                                                                  Task function priority. Lower values have higher priority.

                                                                                                                                                  +
                                                                                                                                                  strategy?:
                                                                                                                                                      | "FAIR_SHARE"
                                                                                                                                                      | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                      | "LEAST_BUSY"
                                                                                                                                                      | "LEAST_ELU"
                                                                                                                                                      | "LEAST_USED"
                                                                                                                                                      | "ROUND_ROBIN"
                                                                                                                                                      | "WEIGHTED_ROUND_ROBIN"

                                                                                                                                                  Task function worker choice strategy.

                                                                                                                                                  +
                                                                                                                                                  diff --git a/docs/interfaces/src.TaskPerformance.html b/docs/interfaces/src.TaskPerformance.html index f886d66db..594be2fb3 100644 --- a/docs/interfaces/src.TaskPerformance.html +++ b/docs/interfaces/src.TaskPerformance.html @@ -1,10 +1,10 @@ -TaskPerformance | poolifier - v5.1.6
                                                                                                                                                  poolifier - v5.1.6
                                                                                                                                                    Preparing search index...

                                                                                                                                                    Interface TaskPerformanceInternal

                                                                                                                                                    Task performance.

                                                                                                                                                    -
                                                                                                                                                    interface TaskPerformance {
                                                                                                                                                        elu?: EventLoopUtilization;
                                                                                                                                                        name: string;
                                                                                                                                                        runTime?: number;
                                                                                                                                                        timestamp: number;
                                                                                                                                                    }
                                                                                                                                                    Index

                                                                                                                                                    Properties

                                                                                                                                                    elu? +TaskPerformance | poolifier - v5.1.7
                                                                                                                                                    poolifier - v5.1.7
                                                                                                                                                      Preparing search index...

                                                                                                                                                      Interface TaskPerformanceInternal

                                                                                                                                                      Task performance.

                                                                                                                                                      +
                                                                                                                                                      interface TaskPerformance {
                                                                                                                                                          elu?: EventLoopUtilization;
                                                                                                                                                          name: string;
                                                                                                                                                          runTime?: number;
                                                                                                                                                          timestamp: number;
                                                                                                                                                      }
                                                                                                                                                      Index

                                                                                                                                                      Properties

                                                                                                                                                      elu?: EventLoopUtilization

                                                                                                                                                      Task event loop utilization.

                                                                                                                                                      -
                                                                                                                                                      name: string

                                                                                                                                                      Task name.

                                                                                                                                                      -
                                                                                                                                                      runTime?: number

                                                                                                                                                      Task runtime.

                                                                                                                                                      -
                                                                                                                                                      timestamp: number

                                                                                                                                                      Task performance timestamp.

                                                                                                                                                      -
                                                                                                                                                      +
                                                                                                                                                      name: string

                                                                                                                                                      Task name.

                                                                                                                                                      +
                                                                                                                                                      runTime?: number

                                                                                                                                                      Task runtime.

                                                                                                                                                      +
                                                                                                                                                      timestamp: number

                                                                                                                                                      Task performance timestamp.

                                                                                                                                                      +
                                                                                                                                                      diff --git a/docs/interfaces/src.TaskStatistics.html b/docs/interfaces/src.TaskStatistics.html index 0feac69aa..fb9e7d1f3 100644 --- a/docs/interfaces/src.TaskStatistics.html +++ b/docs/interfaces/src.TaskStatistics.html @@ -1,5 +1,5 @@ -TaskStatistics | poolifier - v5.1.6
                                                                                                                                                      poolifier - v5.1.6
                                                                                                                                                        Preparing search index...

                                                                                                                                                        Interface TaskStatisticsInternal

                                                                                                                                                        Task statistics.

                                                                                                                                                        -
                                                                                                                                                        interface TaskStatistics {
                                                                                                                                                            executed: number;
                                                                                                                                                            executing: number;
                                                                                                                                                            failed: number;
                                                                                                                                                            maxQueued?: number;
                                                                                                                                                            queued: number;
                                                                                                                                                            sequentiallyStolen: number;
                                                                                                                                                            stolen: number;
                                                                                                                                                        }
                                                                                                                                                        Index

                                                                                                                                                        Properties

                                                                                                                                                        executed +TaskStatistics | poolifier - v5.1.7
                                                                                                                                                        poolifier - v5.1.7
                                                                                                                                                          Preparing search index...

                                                                                                                                                          Interface TaskStatisticsInternal

                                                                                                                                                          Task statistics.

                                                                                                                                                          +
                                                                                                                                                          interface TaskStatistics {
                                                                                                                                                              executed: number;
                                                                                                                                                              executing: number;
                                                                                                                                                              failed: number;
                                                                                                                                                              maxQueued?: number;
                                                                                                                                                              queued: number;
                                                                                                                                                              sequentiallyStolen: number;
                                                                                                                                                              stolen: number;
                                                                                                                                                          }
                                                                                                                                                          Index

                                                                                                                                                          Properties

                                                                                                                                                          executed: number

                                                                                                                                                          Number of executed tasks.

                                                                                                                                                          -
                                                                                                                                                          executing: number

                                                                                                                                                          Number of executing tasks.

                                                                                                                                                          -
                                                                                                                                                          failed: number

                                                                                                                                                          Number of failed tasks.

                                                                                                                                                          -
                                                                                                                                                          maxQueued?: number

                                                                                                                                                          Maximum number of queued tasks.

                                                                                                                                                          -
                                                                                                                                                          queued: number

                                                                                                                                                          Number of queued tasks.

                                                                                                                                                          -
                                                                                                                                                          sequentiallyStolen: number

                                                                                                                                                          Number of sequentially stolen tasks.

                                                                                                                                                          -
                                                                                                                                                          stolen: number

                                                                                                                                                          Number of stolen tasks.

                                                                                                                                                          -
                                                                                                                                                          +
                                                                                                                                                          executing: number

                                                                                                                                                          Number of executing tasks.

                                                                                                                                                          +
                                                                                                                                                          failed: number

                                                                                                                                                          Number of failed tasks.

                                                                                                                                                          +
                                                                                                                                                          maxQueued?: number

                                                                                                                                                          Maximum number of queued tasks.

                                                                                                                                                          +
                                                                                                                                                          queued: number

                                                                                                                                                          Number of queued tasks.

                                                                                                                                                          +
                                                                                                                                                          sequentiallyStolen: number

                                                                                                                                                          Number of sequentially stolen tasks.

                                                                                                                                                          +
                                                                                                                                                          stolen: number

                                                                                                                                                          Number of stolen tasks.

                                                                                                                                                          +
                                                                                                                                                          diff --git a/docs/interfaces/src.TaskStatisticsRequirements.html b/docs/interfaces/src.TaskStatisticsRequirements.html index 888757cc3..be7b69a19 100644 --- a/docs/interfaces/src.TaskStatisticsRequirements.html +++ b/docs/interfaces/src.TaskStatisticsRequirements.html @@ -1,8 +1,8 @@ -TaskStatisticsRequirements | poolifier - v5.1.6
                                                                                                                                                          poolifier - v5.1.6
                                                                                                                                                            Preparing search index...

                                                                                                                                                            Interface TaskStatisticsRequirementsInternal

                                                                                                                                                            Pool worker node worker usage statistics requirements.

                                                                                                                                                            -
                                                                                                                                                            interface TaskStatisticsRequirements {
                                                                                                                                                                elu: MeasurementStatisticsRequirements;
                                                                                                                                                                runTime: MeasurementStatisticsRequirements;
                                                                                                                                                                waitTime: MeasurementStatisticsRequirements;
                                                                                                                                                            }
                                                                                                                                                            Index

                                                                                                                                                            Properties

                                                                                                                                                            elu +TaskStatisticsRequirements | poolifier - v5.1.7
                                                                                                                                                            poolifier - v5.1.7
                                                                                                                                                              Preparing search index...

                                                                                                                                                              Interface TaskStatisticsRequirementsInternal

                                                                                                                                                              Pool worker node worker usage statistics requirements.

                                                                                                                                                              +
                                                                                                                                                              interface TaskStatisticsRequirements {
                                                                                                                                                                  elu: MeasurementStatisticsRequirements;
                                                                                                                                                                  runTime: MeasurementStatisticsRequirements;
                                                                                                                                                                  waitTime: MeasurementStatisticsRequirements;
                                                                                                                                                              }
                                                                                                                                                              Index

                                                                                                                                                              Properties

                                                                                                                                                              Properties

                                                                                                                                                              Tasks event loop utilization requirements.

                                                                                                                                                              -

                                                                                                                                                              Tasks runtime requirements.

                                                                                                                                                              -

                                                                                                                                                              Tasks wait time requirements.

                                                                                                                                                              -
                                                                                                                                                              +

                                                                                                                                                              Tasks runtime requirements.

                                                                                                                                                              +

                                                                                                                                                              Tasks wait time requirements.

                                                                                                                                                              +
                                                                                                                                                              diff --git a/docs/interfaces/src.TasksQueueOptions.html b/docs/interfaces/src.TasksQueueOptions.html index 8e12c52d8..cf467a966 100644 --- a/docs/interfaces/src.TasksQueueOptions.html +++ b/docs/interfaces/src.TasksQueueOptions.html @@ -1,5 +1,5 @@ -TasksQueueOptions | poolifier - v5.1.6
                                                                                                                                                              poolifier - v5.1.6
                                                                                                                                                                Preparing search index...

                                                                                                                                                                Interface TasksQueueOptions

                                                                                                                                                                Worker node tasks queue options.

                                                                                                                                                                -
                                                                                                                                                                interface TasksQueueOptions {
                                                                                                                                                                    concurrency?: number;
                                                                                                                                                                    size?: number;
                                                                                                                                                                    tasksFinishedTimeout?: number;
                                                                                                                                                                    tasksStealingOnBackPressure?: boolean;
                                                                                                                                                                    tasksStealingRatio?: number;
                                                                                                                                                                    taskStealing?: boolean;
                                                                                                                                                                }
                                                                                                                                                                Index

                                                                                                                                                                Properties

                                                                                                                                                                concurrency? +TasksQueueOptions | poolifier - v5.1.7
                                                                                                                                                                poolifier - v5.1.7
                                                                                                                                                                  Preparing search index...

                                                                                                                                                                  Interface TasksQueueOptions

                                                                                                                                                                  Worker node tasks queue options.

                                                                                                                                                                  +
                                                                                                                                                                  interface TasksQueueOptions {
                                                                                                                                                                      concurrency?: number;
                                                                                                                                                                      size?: number;
                                                                                                                                                                      tasksFinishedTimeout?: number;
                                                                                                                                                                      tasksStealingOnBackPressure?: boolean;
                                                                                                                                                                      tasksStealingRatio?: number;
                                                                                                                                                                      taskStealing?: boolean;
                                                                                                                                                                  }
                                                                                                                                                                  Index

                                                                                                                                                                  Properties

                                                                                                                                                                  1
                                                                                                                                                                   
                                                                                                                                                                  -
                                                                                                                                                                  size?: number

                                                                                                                                                                  Maximum tasks queue size per worker node flagging it as back pressured.

                                                                                                                                                                  +
                                                                                                                                                                  size?: number

                                                                                                                                                                  Maximum tasks queue size per worker node flagging it as back pressured.

                                                                                                                                                                  (pool maximum size)^2
                                                                                                                                                                   
                                                                                                                                                                  -
                                                                                                                                                                  tasksFinishedTimeout?: number

                                                                                                                                                                  Queued tasks finished timeout in milliseconds at worker node termination.

                                                                                                                                                                  +
                                                                                                                                                                  tasksFinishedTimeout?: number

                                                                                                                                                                  Queued tasks finished timeout in milliseconds at worker node termination.

                                                                                                                                                                  2000
                                                                                                                                                                   
                                                                                                                                                                  -
                                                                                                                                                                  tasksStealingOnBackPressure?: boolean

                                                                                                                                                                  Whether to enable tasks stealing under back pressure.

                                                                                                                                                                  +
                                                                                                                                                                  tasksStealingOnBackPressure?: boolean

                                                                                                                                                                  Whether to enable tasks stealing under back pressure.

                                                                                                                                                                  true
                                                                                                                                                                   
                                                                                                                                                                  -
                                                                                                                                                                  tasksStealingRatio?: number

                                                                                                                                                                  Ratio of worker nodes that can steal tasks from another worker node.

                                                                                                                                                                  +
                                                                                                                                                                  tasksStealingRatio?: number

                                                                                                                                                                  Ratio of worker nodes that can steal tasks from another worker node.

                                                                                                                                                                  0.6
                                                                                                                                                                   
                                                                                                                                                                  -
                                                                                                                                                                  taskStealing?: boolean

                                                                                                                                                                  Whether to enable task stealing on idle.

                                                                                                                                                                  +
                                                                                                                                                                  taskStealing?: boolean

                                                                                                                                                                  Whether to enable task stealing on idle.

                                                                                                                                                                  true
                                                                                                                                                                   
                                                                                                                                                                  -
                                                                                                                                                                  +
                                                                                                                                                                  diff --git a/docs/interfaces/src.WorkerChoiceStrategiesContext.html b/docs/interfaces/src.WorkerChoiceStrategiesContext.html index d0c0cda6f..9d7222b64 100644 --- a/docs/interfaces/src.WorkerChoiceStrategiesContext.html +++ b/docs/interfaces/src.WorkerChoiceStrategiesContext.html @@ -1,8 +1,8 @@ -WorkerChoiceStrategiesContext | poolifier - v5.1.6
                                                                                                                                                                  poolifier - v5.1.6
                                                                                                                                                                    Preparing search index...

                                                                                                                                                                    Interface WorkerChoiceStrategiesContext<Worker, Data, Response>Internal

                                                                                                                                                                    The worker choice strategies context.

                                                                                                                                                                    -
                                                                                                                                                                    interface WorkerChoiceStrategiesContext<
                                                                                                                                                                        Worker extends IWorker,
                                                                                                                                                                        Data = unknown,
                                                                                                                                                                        Response = unknown,
                                                                                                                                                                    > {
                                                                                                                                                                        execute(
                                                                                                                                                                            workerChoiceStrategy?:
                                                                                                                                                                                | "FAIR_SHARE"
                                                                                                                                                                                | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                                                | "LEAST_BUSY"
                                                                                                                                                                                | "LEAST_ELU"
                                                                                                                                                                                | "LEAST_USED"
                                                                                                                                                                                | "ROUND_ROBIN"
                                                                                                                                                                                | "WEIGHTED_ROUND_ROBIN",
                                                                                                                                                                        ): number;
                                                                                                                                                                        getPolicy(): StrategyPolicy;
                                                                                                                                                                        getStrategyRetries(): number;
                                                                                                                                                                        getTaskStatisticsRequirements(): TaskStatisticsRequirements;
                                                                                                                                                                        remove(workerNodeKey: number): boolean;
                                                                                                                                                                        setDefaultWorkerChoiceStrategy(
                                                                                                                                                                            workerChoiceStrategy:
                                                                                                                                                                                | "FAIR_SHARE"
                                                                                                                                                                                | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                                                | "LEAST_BUSY"
                                                                                                                                                                                | "LEAST_ELU"
                                                                                                                                                                                | "LEAST_USED"
                                                                                                                                                                                | "ROUND_ROBIN"
                                                                                                                                                                                | "WEIGHTED_ROUND_ROBIN",
                                                                                                                                                                            opts?: WorkerChoiceStrategyOptions,
                                                                                                                                                                        ): void;
                                                                                                                                                                        setOptions(opts: undefined | WorkerChoiceStrategyOptions): void;
                                                                                                                                                                        syncWorkerChoiceStrategies(
                                                                                                                                                                            workerChoiceStrategies: Set<
                                                                                                                                                                                | "FAIR_SHARE"
                                                                                                                                                                                | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                                                | "LEAST_BUSY"
                                                                                                                                                                                | "LEAST_ELU"
                                                                                                                                                                                | "LEAST_USED"
                                                                                                                                                                                | "ROUND_ROBIN"
                                                                                                                                                                                | "WEIGHTED_ROUND_ROBIN",
                                                                                                                                                                            >,
                                                                                                                                                                            opts?: WorkerChoiceStrategyOptions,
                                                                                                                                                                        ): void;
                                                                                                                                                                        update(workerNodeKey: number): boolean;
                                                                                                                                                                    }

                                                                                                                                                                    Type Parameters

                                                                                                                                                                    • Worker extends IWorker

                                                                                                                                                                      Type of worker.

                                                                                                                                                                      -
                                                                                                                                                                    • Data = unknown

                                                                                                                                                                      Type of data sent to the worker. This can only be structured-cloneable data.

                                                                                                                                                                      -
                                                                                                                                                                    • Response = unknown

                                                                                                                                                                      Type of execution response. This can only be structured-cloneable data.

                                                                                                                                                                      -
                                                                                                                                                                    Index

                                                                                                                                                                    Methods

                                                                                                                                                                    execute +WorkerChoiceStrategiesContext | poolifier - v5.1.7
                                                                                                                                                                    poolifier - v5.1.7
                                                                                                                                                                      Preparing search index...

                                                                                                                                                                      Interface WorkerChoiceStrategiesContext<Worker, Data, Response>Internal

                                                                                                                                                                      The worker choice strategies context.

                                                                                                                                                                      +
                                                                                                                                                                      interface WorkerChoiceStrategiesContext<
                                                                                                                                                                          Worker extends IWorker,
                                                                                                                                                                          Data = unknown,
                                                                                                                                                                          Response = unknown,
                                                                                                                                                                      > {
                                                                                                                                                                          execute(
                                                                                                                                                                              workerChoiceStrategy?:
                                                                                                                                                                                  | "FAIR_SHARE"
                                                                                                                                                                                  | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                                                  | "LEAST_BUSY"
                                                                                                                                                                                  | "LEAST_ELU"
                                                                                                                                                                                  | "LEAST_USED"
                                                                                                                                                                                  | "ROUND_ROBIN"
                                                                                                                                                                                  | "WEIGHTED_ROUND_ROBIN",
                                                                                                                                                                          ): number;
                                                                                                                                                                          getPolicy(): StrategyPolicy;
                                                                                                                                                                          getStrategyRetries(): number;
                                                                                                                                                                          getTaskStatisticsRequirements(): TaskStatisticsRequirements;
                                                                                                                                                                          remove(workerNodeKey: number): boolean;
                                                                                                                                                                          setDefaultWorkerChoiceStrategy(
                                                                                                                                                                              workerChoiceStrategy:
                                                                                                                                                                                  | "FAIR_SHARE"
                                                                                                                                                                                  | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                                                  | "LEAST_BUSY"
                                                                                                                                                                                  | "LEAST_ELU"
                                                                                                                                                                                  | "LEAST_USED"
                                                                                                                                                                                  | "ROUND_ROBIN"
                                                                                                                                                                                  | "WEIGHTED_ROUND_ROBIN",
                                                                                                                                                                              opts?: WorkerChoiceStrategyOptions,
                                                                                                                                                                          ): void;
                                                                                                                                                                          setOptions(opts: WorkerChoiceStrategyOptions | undefined): void;
                                                                                                                                                                          syncWorkerChoiceStrategies(
                                                                                                                                                                              workerChoiceStrategies: Set<
                                                                                                                                                                                  | "FAIR_SHARE"
                                                                                                                                                                                  | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                                                  | "LEAST_BUSY"
                                                                                                                                                                                  | "LEAST_ELU"
                                                                                                                                                                                  | "LEAST_USED"
                                                                                                                                                                                  | "ROUND_ROBIN"
                                                                                                                                                                                  | "WEIGHTED_ROUND_ROBIN",
                                                                                                                                                                              >,
                                                                                                                                                                              opts?: WorkerChoiceStrategyOptions,
                                                                                                                                                                          ): void;
                                                                                                                                                                          update(workerNodeKey: number): boolean;
                                                                                                                                                                      }

                                                                                                                                                                      Type Parameters

                                                                                                                                                                      • Worker extends IWorker

                                                                                                                                                                        Type of worker.

                                                                                                                                                                        +
                                                                                                                                                                      • Data = unknown

                                                                                                                                                                        Type of data sent to the worker. This can only be structured-cloneable data.

                                                                                                                                                                        +
                                                                                                                                                                      • Response = unknown

                                                                                                                                                                        Type of execution response. This can only be structured-cloneable data.

                                                                                                                                                                        +
                                                                                                                                                                      Index

                                                                                                                                                                      Methods

                                                                                                                                                                      • Executes the given worker choice strategy in the context algorithm.

                                                                                                                                                                        Parameters

                                                                                                                                                                        • workerChoiceStrategy:
                                                                                                                                                                              | "FAIR_SHARE"
                                                                                                                                                                              | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                                              | "LEAST_BUSY"
                                                                                                                                                                              | "LEAST_ELU"
                                                                                                                                                                              | "LEAST_USED"
                                                                                                                                                                              | "ROUND_ROBIN"
                                                                                                                                                                              | "WEIGHTED_ROUND_ROBIN" = ...

                                                                                                                                                                          The worker choice strategy algorithm to execute.

                                                                                                                                                                          -

                                                                                                                                                                        Returns number

                                                                                                                                                                        The key of the worker node.

                                                                                                                                                                        +

                                                                                                                                                                      Returns number

                                                                                                                                                                      The key of the worker node.

                                                                                                                                                                      this.defaultWorkerChoiceStrategy
                                                                                                                                                                       
                                                                                                                                                                      -

                                                                                                                                                                      https://nodejs.org/api/errors.html#class-error If after computed retries the worker node key is null or undefined.

                                                                                                                                                                      -
                                                                                                                                                                      • Sets the default worker choice strategy to use in the context.

                                                                                                                                                                        +

                                                                                                                                                                      Returns boolean

                                                                                                                                                                      true if the removal is successful, false otherwise.

                                                                                                                                                                      +
                                                                                                                                                                      • Sets the default worker choice strategy to use in the context.

                                                                                                                                                                        Parameters

                                                                                                                                                                        • workerChoiceStrategy:
                                                                                                                                                                              | "FAIR_SHARE"
                                                                                                                                                                              | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                                              | "LEAST_BUSY"
                                                                                                                                                                              | "LEAST_ELU"
                                                                                                                                                                              | "LEAST_USED"
                                                                                                                                                                              | "ROUND_ROBIN"
                                                                                                                                                                              | "WEIGHTED_ROUND_ROBIN"

                                                                                                                                                                          The default worker choice strategy to set.

                                                                                                                                                                          -
                                                                                                                                                                        • Optionalopts: WorkerChoiceStrategyOptions

                                                                                                                                                                          The worker choice strategy options.

                                                                                                                                                                          -

                                                                                                                                                                        Returns void

                                                                                                                                                                      • Synchronizes the active worker choice strategies in the context with the given worker choice strategies.

                                                                                                                                                                        +
                                                                                                                                                                      • Optionalopts: WorkerChoiceStrategyOptions

                                                                                                                                                                        The worker choice strategy options.

                                                                                                                                                                        +

                                                                                                                                                                      Returns void

                                                                                                                                                                      • Synchronizes the active worker choice strategies in the context with the given worker choice strategies.

                                                                                                                                                                        Parameters

                                                                                                                                                                        • workerChoiceStrategies: Set<
                                                                                                                                                                              | "FAIR_SHARE"
                                                                                                                                                                              | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                                              | "LEAST_BUSY"
                                                                                                                                                                              | "LEAST_ELU"
                                                                                                                                                                              | "LEAST_USED"
                                                                                                                                                                              | "ROUND_ROBIN"
                                                                                                                                                                              | "WEIGHTED_ROUND_ROBIN",
                                                                                                                                                                          >

                                                                                                                                                                          The worker choice strategies to synchronize.

                                                                                                                                                                          -
                                                                                                                                                                        • Optionalopts: WorkerChoiceStrategyOptions

                                                                                                                                                                          The worker choice strategy options.

                                                                                                                                                                          -

                                                                                                                                                                        Returns void

                                                                                                                                                                      • Updates the worker node key in the active worker choice strategies in the context internals.

                                                                                                                                                                        +
                                                                                                                                                                      • Optionalopts: WorkerChoiceStrategyOptions

                                                                                                                                                                        The worker choice strategy options.

                                                                                                                                                                        +

                                                                                                                                                                      Returns void

                                                                                                                                                                      +

                                                                                                                                                                      Returns boolean

                                                                                                                                                                      true if the update is successful, false otherwise.

                                                                                                                                                                      +
                                                                                                                                                                      diff --git a/docs/interfaces/src.WorkerChoiceStrategyOptions.html b/docs/interfaces/src.WorkerChoiceStrategyOptions.html index 6b9aff81c..e4e35ec62 100644 --- a/docs/interfaces/src.WorkerChoiceStrategyOptions.html +++ b/docs/interfaces/src.WorkerChoiceStrategyOptions.html @@ -1,5 +1,5 @@ -WorkerChoiceStrategyOptions | poolifier - v5.1.6
                                                                                                                                                                      poolifier - v5.1.6
                                                                                                                                                                        Preparing search index...

                                                                                                                                                                        Interface WorkerChoiceStrategyOptions

                                                                                                                                                                        Worker choice strategy options.

                                                                                                                                                                        -
                                                                                                                                                                        interface WorkerChoiceStrategyOptions {
                                                                                                                                                                            elu?: MeasurementOptions;
                                                                                                                                                                            measurement?: "elu" | "runTime" | "waitTime";
                                                                                                                                                                            runTime?: MeasurementOptions;
                                                                                                                                                                            waitTime?: MeasurementOptions;
                                                                                                                                                                            weights?: Record<number, number>;
                                                                                                                                                                        }
                                                                                                                                                                        Index

                                                                                                                                                                        Properties

                                                                                                                                                                        elu? +WorkerChoiceStrategyOptions | poolifier - v5.1.7
                                                                                                                                                                        poolifier - v5.1.7
                                                                                                                                                                          Preparing search index...

                                                                                                                                                                          Interface WorkerChoiceStrategyOptions

                                                                                                                                                                          Worker choice strategy options.

                                                                                                                                                                          +
                                                                                                                                                                          interface WorkerChoiceStrategyOptions {
                                                                                                                                                                              elu?: MeasurementOptions;
                                                                                                                                                                              measurement?: "elu" | "runTime" | "waitTime";
                                                                                                                                                                              runTime?: MeasurementOptions;
                                                                                                                                                                              waitTime?: MeasurementOptions;
                                                                                                                                                                              weights?: Record<number, number>;
                                                                                                                                                                          }
                                                                                                                                                                          Index

                                                                                                                                                                          Properties

                                                                                                                                                                          elu? measurement? runTime? waitTime? @@ -8,18 +8,18 @@
                                                                                                                                                                          { median: false }
                                                                                                                                                                           
                                                                                                                                                                          -
                                                                                                                                                                          measurement?: "elu" | "runTime" | "waitTime"

                                                                                                                                                                          Measurement to use in worker choice strategy supporting it.

                                                                                                                                                                          -

                                                                                                                                                                          Runtime options.

                                                                                                                                                                          +
                                                                                                                                                                          measurement?: "elu" | "runTime" | "waitTime"

                                                                                                                                                                          Measurement to use in worker choice strategy supporting it.

                                                                                                                                                                          +

                                                                                                                                                                          Runtime options.

                                                                                                                                                                          { median: false }
                                                                                                                                                                           
                                                                                                                                                                          -

                                                                                                                                                                          Wait time options.

                                                                                                                                                                          +

                                                                                                                                                                          Wait time options.

                                                                                                                                                                          { median: false }
                                                                                                                                                                           
                                                                                                                                                                          -
                                                                                                                                                                          weights?: Record<number, number>

                                                                                                                                                                          Worker weights to use for weighted round robin worker selection strategies. +

                                                                                                                                                                          weights?: Record<number, number>

                                                                                                                                                                          Worker weights to use for weighted round robin worker selection strategies. A weight is tasks maximum execution time in milliseconds for a worker node.

                                                                                                                                                                          Weights computed automatically given the CPU performance.
                                                                                                                                                                           
                                                                                                                                                                          -
                                                                                                                                                                          +
                                                                                                                                                                          diff --git a/docs/interfaces/src.WorkerError.html b/docs/interfaces/src.WorkerError.html index f16bf99a7..823a26d3e 100644 --- a/docs/interfaces/src.WorkerError.html +++ b/docs/interfaces/src.WorkerError.html @@ -1,15 +1,15 @@ -WorkerError | poolifier - v5.1.6
                                                                                                                                                                          poolifier - v5.1.6
                                                                                                                                                                            Preparing search index...

                                                                                                                                                                            Interface WorkerError<Data>

                                                                                                                                                                            Worker error.

                                                                                                                                                                            -
                                                                                                                                                                            interface WorkerError<Data = unknown> {
                                                                                                                                                                                aborted: boolean;
                                                                                                                                                                                data?: Data;
                                                                                                                                                                                error?: Error;
                                                                                                                                                                                message: string;
                                                                                                                                                                                name?: string;
                                                                                                                                                                                stack?: string;
                                                                                                                                                                            }

                                                                                                                                                                            Type Parameters

                                                                                                                                                                            • Data = unknown

                                                                                                                                                                              Type of data sent to the worker triggering an error. This can only be structured-cloneable data.

                                                                                                                                                                              -
                                                                                                                                                                            Index

                                                                                                                                                                            Properties

                                                                                                                                                                            aborted +WorkerError | poolifier - v5.1.7
                                                                                                                                                                            poolifier - v5.1.7
                                                                                                                                                                              Preparing search index...

                                                                                                                                                                              Interface WorkerError<Data>

                                                                                                                                                                              Worker error.

                                                                                                                                                                              +
                                                                                                                                                                              interface WorkerError<Data = unknown> {
                                                                                                                                                                                  aborted: boolean;
                                                                                                                                                                                  data?: Data;
                                                                                                                                                                                  error?: Error;
                                                                                                                                                                                  message: string;
                                                                                                                                                                                  name?: string;
                                                                                                                                                                                  stack?: string;
                                                                                                                                                                              }

                                                                                                                                                                              Type Parameters

                                                                                                                                                                              • Data = unknown

                                                                                                                                                                                Type of data sent to the worker triggering an error. This can only be structured-cloneable data.

                                                                                                                                                                                +
                                                                                                                                                                              Index

                                                                                                                                                                              Properties

                                                                                                                                                                              aborted: boolean

                                                                                                                                                                              Whether the error is an abort error or not.

                                                                                                                                                                              -
                                                                                                                                                                              data?: Data

                                                                                                                                                                              Data triggering the error.

                                                                                                                                                                              -
                                                                                                                                                                              error?: Error

                                                                                                                                                                              Error object.

                                                                                                                                                                              -
                                                                                                                                                                              message: string

                                                                                                                                                                              Error message.

                                                                                                                                                                              -
                                                                                                                                                                              name?: string

                                                                                                                                                                              Task function name triggering the error.

                                                                                                                                                                              -
                                                                                                                                                                              stack?: string

                                                                                                                                                                              Error stack trace.

                                                                                                                                                                              -
                                                                                                                                                                              +
                                                                                                                                                                              data?: Data

                                                                                                                                                                              Data triggering the error.

                                                                                                                                                                              +
                                                                                                                                                                              error?: Error

                                                                                                                                                                              Error object.

                                                                                                                                                                              +
                                                                                                                                                                              message: string

                                                                                                                                                                              Error message.

                                                                                                                                                                              +
                                                                                                                                                                              name?: string

                                                                                                                                                                              Task function name triggering the error.

                                                                                                                                                                              +
                                                                                                                                                                              stack?: string

                                                                                                                                                                              Error stack trace.

                                                                                                                                                                              +
                                                                                                                                                                              diff --git a/docs/interfaces/src.WorkerInfo.html b/docs/interfaces/src.WorkerInfo.html index 8c906a6b6..56233ece3 100644 --- a/docs/interfaces/src.WorkerInfo.html +++ b/docs/interfaces/src.WorkerInfo.html @@ -1,5 +1,5 @@ -WorkerInfo | poolifier - v5.1.6
                                                                                                                                                                              poolifier - v5.1.6
                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                Interface WorkerInfoInternal

                                                                                                                                                                                Worker information.

                                                                                                                                                                                -
                                                                                                                                                                                interface WorkerInfo {
                                                                                                                                                                                    backPressure: boolean;
                                                                                                                                                                                    backPressureStealing: boolean;
                                                                                                                                                                                    continuousStealing: boolean;
                                                                                                                                                                                    dynamic: boolean;
                                                                                                                                                                                    id: undefined | number;
                                                                                                                                                                                    queuedTaskAbortion: boolean;
                                                                                                                                                                                    ready: boolean;
                                                                                                                                                                                    stealing: boolean;
                                                                                                                                                                                    stolen: boolean;
                                                                                                                                                                                    taskFunctionsProperties?: TaskFunctionProperties[];
                                                                                                                                                                                    type: "cluster" | "thread";
                                                                                                                                                                                }
                                                                                                                                                                                Index

                                                                                                                                                                                Properties

                                                                                                                                                                                backPressure +WorkerInfo | poolifier - v5.1.7
                                                                                                                                                                                poolifier - v5.1.7
                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                  Interface WorkerInfoInternal

                                                                                                                                                                                  Worker information.

                                                                                                                                                                                  +
                                                                                                                                                                                  interface WorkerInfo {
                                                                                                                                                                                      backPressure: boolean;
                                                                                                                                                                                      backPressureStealing: boolean;
                                                                                                                                                                                      continuousStealing: boolean;
                                                                                                                                                                                      dynamic: boolean;
                                                                                                                                                                                      id: number | undefined;
                                                                                                                                                                                      queuedTaskAbortion: boolean;
                                                                                                                                                                                      ready: boolean;
                                                                                                                                                                                      stealing: boolean;
                                                                                                                                                                                      stolen: boolean;
                                                                                                                                                                                      taskFunctionsProperties?: TaskFunctionProperties[];
                                                                                                                                                                                      type: "cluster" | "thread";
                                                                                                                                                                                  }
                                                                                                                                                                                  Index

                                                                                                                                                                                  Properties

                                                                                                                                                                                  backPressure: boolean

                                                                                                                                                                                  Back pressure flag. This flag is set to true when worker node tasks queue is back pressured.

                                                                                                                                                                                  -
                                                                                                                                                                                  backPressureStealing: boolean

                                                                                                                                                                                  Back pressure stealing flag. +

                                                                                                                                                                                  backPressureStealing: boolean

                                                                                                                                                                                  Back pressure stealing flag. This flag is set to true when worker node is stealing one task from another back pressured worker node.

                                                                                                                                                                                  -
                                                                                                                                                                                  continuousStealing: boolean

                                                                                                                                                                                  Continuous stealing flag. +

                                                                                                                                                                                  continuousStealing: boolean

                                                                                                                                                                                  Continuous stealing flag. This flag is set to true when worker node is continuously stealing tasks from other worker nodes.

                                                                                                                                                                                  -
                                                                                                                                                                                  dynamic: boolean

                                                                                                                                                                                  Dynamic flag.

                                                                                                                                                                                  -
                                                                                                                                                                                  id: undefined | number

                                                                                                                                                                                  Worker id.

                                                                                                                                                                                  -
                                                                                                                                                                                  queuedTaskAbortion: boolean

                                                                                                                                                                                  Queued task abortion flag. +

                                                                                                                                                                                  dynamic: boolean

                                                                                                                                                                                  Dynamic flag.

                                                                                                                                                                                  +
                                                                                                                                                                                  id: number | undefined

                                                                                                                                                                                  Worker id.

                                                                                                                                                                                  +
                                                                                                                                                                                  queuedTaskAbortion: boolean

                                                                                                                                                                                  Queued task abortion flag. This flag is set to true when worker node is aborting a queued task.

                                                                                                                                                                                  -
                                                                                                                                                                                  ready: boolean

                                                                                                                                                                                  Ready flag.

                                                                                                                                                                                  -
                                                                                                                                                                                  stealing: boolean

                                                                                                                                                                                  Stealing flag. +

                                                                                                                                                                                  ready: boolean

                                                                                                                                                                                  Ready flag.

                                                                                                                                                                                  +
                                                                                                                                                                                  stealing: boolean

                                                                                                                                                                                  Stealing flag. This flag is set to true when worker node is stealing one task from another worker node.

                                                                                                                                                                                  -
                                                                                                                                                                                  stolen: boolean

                                                                                                                                                                                  Stolen flag. +

                                                                                                                                                                                  stolen: boolean

                                                                                                                                                                                  Stolen flag. This flag is set to true when worker node has one task stolen from another worker node.

                                                                                                                                                                                  -
                                                                                                                                                                                  taskFunctionsProperties?: TaskFunctionProperties[]

                                                                                                                                                                                  Task functions properties.

                                                                                                                                                                                  -
                                                                                                                                                                                  type: "cluster" | "thread"

                                                                                                                                                                                  Worker type.

                                                                                                                                                                                  -
                                                                                                                                                                                  +
                                                                                                                                                                                  taskFunctionsProperties?: TaskFunctionProperties[]

                                                                                                                                                                                  Task functions properties.

                                                                                                                                                                                  +
                                                                                                                                                                                  type: "cluster" | "thread"

                                                                                                                                                                                  Worker type.

                                                                                                                                                                                  +
                                                                                                                                                                                  diff --git a/docs/interfaces/src.WorkerNodeEventDetail.html b/docs/interfaces/src.WorkerNodeEventDetail.html index 56636e26a..c12ea3954 100644 --- a/docs/interfaces/src.WorkerNodeEventDetail.html +++ b/docs/interfaces/src.WorkerNodeEventDetail.html @@ -1,5 +1,5 @@ -WorkerNodeEventDetail | poolifier - v5.1.6
                                                                                                                                                                                  poolifier - v5.1.6
                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                    Interface WorkerNodeEventDetailInternal

                                                                                                                                                                                    Worker node event detail.

                                                                                                                                                                                    -
                                                                                                                                                                                    interface WorkerNodeEventDetail {
                                                                                                                                                                                        taskId?: `${string}-${string}-${string}-${string}-${string}`;
                                                                                                                                                                                        workerId?: number;
                                                                                                                                                                                        workerNodeKey?: number;
                                                                                                                                                                                    }
                                                                                                                                                                                    Index

                                                                                                                                                                                    Properties

                                                                                                                                                                                    taskId? +WorkerNodeEventDetail | poolifier - v5.1.7
                                                                                                                                                                                    poolifier - v5.1.7
                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                      Interface WorkerNodeEventDetailInternal

                                                                                                                                                                                      Worker node event detail.

                                                                                                                                                                                      +
                                                                                                                                                                                      interface WorkerNodeEventDetail {
                                                                                                                                                                                          taskId?: `${string}-${string}-${string}-${string}-${string}`;
                                                                                                                                                                                          workerId?: number;
                                                                                                                                                                                          workerNodeKey?: number;
                                                                                                                                                                                      }
                                                                                                                                                                                      Index

                                                                                                                                                                                      Properties

                                                                                                                                                                                      taskId?: `${string}-${string}-${string}-${string}-${string}`
                                                                                                                                                                                      workerId?: number
                                                                                                                                                                                      workerNodeKey?: number
                                                                                                                                                                                      +

                                                                                                                                                                                      Properties

                                                                                                                                                                                      taskId?: `${string}-${string}-${string}-${string}-${string}`
                                                                                                                                                                                      workerId?: number
                                                                                                                                                                                      workerNodeKey?: number
                                                                                                                                                                                      diff --git a/docs/interfaces/src.WorkerNodeOptions.html b/docs/interfaces/src.WorkerNodeOptions.html index 96c7c9ddf..7a6ff51cd 100644 --- a/docs/interfaces/src.WorkerNodeOptions.html +++ b/docs/interfaces/src.WorkerNodeOptions.html @@ -1,7 +1,7 @@ -WorkerNodeOptions | poolifier - v5.1.6
                                                                                                                                                                                      poolifier - v5.1.6
                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                        Interface WorkerNodeOptionsInternal

                                                                                                                                                                                        Worker node options.

                                                                                                                                                                                        -
                                                                                                                                                                                        interface WorkerNodeOptions {
                                                                                                                                                                                            env?: Record<string, unknown>;
                                                                                                                                                                                            tasksQueueBackPressureSize: undefined | number;
                                                                                                                                                                                            tasksQueueBucketSize: undefined | number;
                                                                                                                                                                                            tasksQueuePriority: undefined | boolean;
                                                                                                                                                                                            workerOptions?: WorkerOptions;
                                                                                                                                                                                        }
                                                                                                                                                                                        Index

                                                                                                                                                                                        Properties

                                                                                                                                                                                        env? +WorkerNodeOptions | poolifier - v5.1.7
                                                                                                                                                                                        poolifier - v5.1.7
                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                          Interface WorkerNodeOptionsInternal

                                                                                                                                                                                          Worker node options.

                                                                                                                                                                                          +
                                                                                                                                                                                          interface WorkerNodeOptions {
                                                                                                                                                                                              env?: Record<string, unknown>;
                                                                                                                                                                                              tasksQueueBackPressureSize: number | undefined;
                                                                                                                                                                                              tasksQueueBucketSize: number | undefined;
                                                                                                                                                                                              tasksQueuePriority: boolean | undefined;
                                                                                                                                                                                              workerOptions?: WorkerOptions;
                                                                                                                                                                                          }
                                                                                                                                                                                          Index

                                                                                                                                                                                          Properties

                                                                                                                                                                                          env?: Record<string, unknown>
                                                                                                                                                                                          tasksQueueBackPressureSize: undefined | number
                                                                                                                                                                                          tasksQueueBucketSize: undefined | number
                                                                                                                                                                                          tasksQueuePriority: undefined | boolean
                                                                                                                                                                                          workerOptions?: WorkerOptions
                                                                                                                                                                                          +

                                                                                                                                                                                          Properties

                                                                                                                                                                                          env?: Record<string, unknown>
                                                                                                                                                                                          tasksQueueBackPressureSize: number | undefined
                                                                                                                                                                                          tasksQueueBucketSize: number | undefined
                                                                                                                                                                                          tasksQueuePriority: boolean | undefined
                                                                                                                                                                                          workerOptions?: WorkerOptions
                                                                                                                                                                                          diff --git a/docs/interfaces/src.WorkerOptions.html b/docs/interfaces/src.WorkerOptions.html index f8e08ba18..eace48f46 100644 --- a/docs/interfaces/src.WorkerOptions.html +++ b/docs/interfaces/src.WorkerOptions.html @@ -1,5 +1,5 @@ -WorkerOptions | poolifier - v5.1.6
                                                                                                                                                                                          poolifier - v5.1.6
                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                            Interface WorkerOptions

                                                                                                                                                                                            Options for workers.

                                                                                                                                                                                            -
                                                                                                                                                                                            interface WorkerOptions {
                                                                                                                                                                                                killBehavior?: "HARD" | "SOFT";
                                                                                                                                                                                                killHandler?: KillHandler;
                                                                                                                                                                                                maxInactiveTime?: number;
                                                                                                                                                                                            }
                                                                                                                                                                                            Index

                                                                                                                                                                                            Properties

                                                                                                                                                                                            killBehavior? +WorkerOptions | poolifier - v5.1.7
                                                                                                                                                                                            poolifier - v5.1.7
                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                              Interface WorkerOptions

                                                                                                                                                                                              Options for workers.

                                                                                                                                                                                              +
                                                                                                                                                                                              interface WorkerOptions {
                                                                                                                                                                                                  killBehavior?: "HARD" | "SOFT";
                                                                                                                                                                                                  killHandler?: KillHandler;
                                                                                                                                                                                                  maxInactiveTime?: number;
                                                                                                                                                                                              }
                                                                                                                                                                                              Index

                                                                                                                                                                                              Properties

                                                                                                                                                                                              killBehavior?: "HARD" | "SOFT"

                                                                                                                                                                                              killBehavior dictates if your worker will be deleted in case a task is active on it.

                                                                                                                                                                                              @@ -11,9 +11,9 @@
                                                                                                                                                                                              KillBehaviors.SOFT
                                                                                                                                                                                               
                                                                                                                                                                                              -
                                                                                                                                                                                              killHandler?: KillHandler

                                                                                                                                                                                              The function to call when a worker is killed.

                                                                                                                                                                                              +
                                                                                                                                                                                              killHandler?: KillHandler

                                                                                                                                                                                              The function to call when a worker is killed.

                                                                                                                                                                                              () => {}

                                                                                                                                                                                              -
                                                                                                                                                                                              maxInactiveTime?: number

                                                                                                                                                                                              Maximum waiting time in milliseconds for tasks on newly created workers. It must be greater or equal than 5.

                                                                                                                                                                                              +
                                                                                                                                                                                              maxInactiveTime?: number

                                                                                                                                                                                              Maximum waiting time in milliseconds for tasks on newly created workers. It must be greater or equal than 5.

                                                                                                                                                                                              After this time, newly created workers will be terminated. The last active time of your worker will be updated when it terminates a task.

                                                                                                                                                                                                @@ -24,4 +24,4 @@ when this timeout expires your tasks is interrupted before completion and remove
                                                                                                                                                                                              60000
                                                                                                                                                                                               
                                                                                                                                                                                              -
                                                                                                                                                                                              +
                                                                                                                                                                                              diff --git a/docs/interfaces/src.WorkerStatistics.html b/docs/interfaces/src.WorkerStatistics.html index 943d858e8..ca19695c0 100644 --- a/docs/interfaces/src.WorkerStatistics.html +++ b/docs/interfaces/src.WorkerStatistics.html @@ -1,6 +1,6 @@ -WorkerStatistics | poolifier - v5.1.6
                                                                                                                                                                                              poolifier - v5.1.6
                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                Interface WorkerStatisticsInternal

                                                                                                                                                                                                Worker task performance statistics computation settings.

                                                                                                                                                                                                -
                                                                                                                                                                                                interface WorkerStatistics {
                                                                                                                                                                                                    elu: boolean;
                                                                                                                                                                                                    runTime: boolean;
                                                                                                                                                                                                }
                                                                                                                                                                                                Index

                                                                                                                                                                                                Properties

                                                                                                                                                                                                elu +WorkerStatistics | poolifier - v5.1.7
                                                                                                                                                                                                poolifier - v5.1.7
                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                  Interface WorkerStatisticsInternal

                                                                                                                                                                                                  Worker task performance statistics computation settings.

                                                                                                                                                                                                  +
                                                                                                                                                                                                  interface WorkerStatistics {
                                                                                                                                                                                                      elu: boolean;
                                                                                                                                                                                                      runTime: boolean;
                                                                                                                                                                                                  }
                                                                                                                                                                                                  Index

                                                                                                                                                                                                  Properties

                                                                                                                                                                                                  Properties

                                                                                                                                                                                                  elu: boolean

                                                                                                                                                                                                  Whether the worker computes the task event loop utilization (ELU) or not.

                                                                                                                                                                                                  -
                                                                                                                                                                                                  runTime: boolean

                                                                                                                                                                                                  Whether the worker computes the task runtime or not.

                                                                                                                                                                                                  -
                                                                                                                                                                                                  +
                                                                                                                                                                                                  runTime: boolean

                                                                                                                                                                                                  Whether the worker computes the task runtime or not.

                                                                                                                                                                                                  +
                                                                                                                                                                                                  diff --git a/docs/interfaces/src.WorkerUsage.html b/docs/interfaces/src.WorkerUsage.html index c7576508e..f4e96cd79 100644 --- a/docs/interfaces/src.WorkerUsage.html +++ b/docs/interfaces/src.WorkerUsage.html @@ -1,10 +1,10 @@ -WorkerUsage | poolifier - v5.1.6
                                                                                                                                                                                                  poolifier - v5.1.6
                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                    Interface WorkerUsageInternal

                                                                                                                                                                                                    Worker usage statistics.

                                                                                                                                                                                                    -
                                                                                                                                                                                                    interface WorkerUsage {
                                                                                                                                                                                                        elu: EventLoopUtilizationMeasurementStatistics;
                                                                                                                                                                                                        runTime: MeasurementStatistics;
                                                                                                                                                                                                        tasks: TaskStatistics;
                                                                                                                                                                                                        waitTime: MeasurementStatistics;
                                                                                                                                                                                                    }
                                                                                                                                                                                                    Index

                                                                                                                                                                                                    Properties

                                                                                                                                                                                                    elu +WorkerUsage | poolifier - v5.1.7
                                                                                                                                                                                                    poolifier - v5.1.7
                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                      Interface WorkerUsageInternal

                                                                                                                                                                                                      Worker usage statistics.

                                                                                                                                                                                                      +
                                                                                                                                                                                                      interface WorkerUsage {
                                                                                                                                                                                                          elu: EventLoopUtilizationMeasurementStatistics;
                                                                                                                                                                                                          runTime: MeasurementStatistics;
                                                                                                                                                                                                          tasks: TaskStatistics;
                                                                                                                                                                                                          waitTime: MeasurementStatistics;
                                                                                                                                                                                                      }
                                                                                                                                                                                                      Index

                                                                                                                                                                                                      Properties

                                                                                                                                                                                                      Tasks event loop utilization statistics.

                                                                                                                                                                                                      -

                                                                                                                                                                                                      Tasks runtime statistics.

                                                                                                                                                                                                      -

                                                                                                                                                                                                      Tasks statistics.

                                                                                                                                                                                                      -

                                                                                                                                                                                                      Tasks wait time statistics.

                                                                                                                                                                                                      -
                                                                                                                                                                                                      +

                                                                                                                                                                                                      Tasks runtime statistics.

                                                                                                                                                                                                      +

                                                                                                                                                                                                      Tasks statistics.

                                                                                                                                                                                                      +

                                                                                                                                                                                                      Tasks wait time statistics.

                                                                                                                                                                                                      +
                                                                                                                                                                                                      diff --git a/docs/modules/src.html b/docs/modules/src.html index d3cf6ba5c..77ca70eda 100644 --- a/docs/modules/src.html +++ b/docs/modules/src.html @@ -1 +1 @@ -src | poolifier - v5.1.6
                                                                                                                                                                                                      poolifier - v5.1.6
                                                                                                                                                                                                        Preparing search index...
                                                                                                                                                                                                        +src | poolifier - v5.1.7
                                                                                                                                                                                                        poolifier - v5.1.7
                                                                                                                                                                                                          Preparing search index...
                                                                                                                                                                                                          diff --git a/docs/types/src.ClusterPoolOptions.html b/docs/types/src.ClusterPoolOptions.html index bef921b78..398d79a24 100644 --- a/docs/types/src.ClusterPoolOptions.html +++ b/docs/types/src.ClusterPoolOptions.html @@ -1,2 +1,2 @@ -ClusterPoolOptions | poolifier - v5.1.6
                                                                                                                                                                                                          poolifier - v5.1.6
                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                            Type Alias ClusterPoolOptions

                                                                                                                                                                                                            ClusterPoolOptions: PoolOptions<Worker>

                                                                                                                                                                                                            Options for a poolifier cluster pool.

                                                                                                                                                                                                            -
                                                                                                                                                                                                            +ClusterPoolOptions | poolifier - v5.1.7
                                                                                                                                                                                                            poolifier - v5.1.7
                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                              Type Alias ClusterPoolOptions

                                                                                                                                                                                                              ClusterPoolOptions: PoolOptions<Worker>

                                                                                                                                                                                                              Options for a poolifier cluster pool.

                                                                                                                                                                                                              +
                                                                                                                                                                                                              diff --git a/docs/types/src.ErrorHandler.html b/docs/types/src.ErrorHandler.html index 11c0bc6ca..b68891cc7 100644 --- a/docs/types/src.ErrorHandler.html +++ b/docs/types/src.ErrorHandler.html @@ -1,3 +1,3 @@ -ErrorHandler | poolifier - v5.1.6
                                                                                                                                                                                                              poolifier - v5.1.6
                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                Type Alias ErrorHandler<Worker>

                                                                                                                                                                                                                ErrorHandler: (this: Worker, error: Error) => void

                                                                                                                                                                                                                Callback invoked if the worker raised an error.

                                                                                                                                                                                                                +ErrorHandler | poolifier - v5.1.7
                                                                                                                                                                                                                poolifier - v5.1.7
                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                  Type Alias ErrorHandler<Worker>

                                                                                                                                                                                                                  ErrorHandler: (this: Worker, error: Error) => void

                                                                                                                                                                                                                  Callback invoked if the worker raised an error.

                                                                                                                                                                                                                  Type Parameters

                                                                                                                                                                                                                  • Worker extends IWorker

                                                                                                                                                                                                                    Type of worker.

                                                                                                                                                                                                                    -

                                                                                                                                                                                                                  Type Declaration

                                                                                                                                                                                                                    • (this: Worker, error: Error): void
                                                                                                                                                                                                                    • Parameters

                                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                                  +

                                                                                                                                                                                                                  Type Declaration

                                                                                                                                                                                                                    • (this: Worker, error: Error): void
                                                                                                                                                                                                                    • Parameters

                                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                                  diff --git a/docs/types/src.EventHandler.html b/docs/types/src.EventHandler.html index 328ca442f..c65bef9cf 100644 --- a/docs/types/src.EventHandler.html +++ b/docs/types/src.EventHandler.html @@ -1,3 +1,3 @@ -EventHandler | poolifier - v5.1.6
                                                                                                                                                                                                                  poolifier - v5.1.6
                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                    Type Alias EventHandler<Worker>

                                                                                                                                                                                                                    EventHandler:
                                                                                                                                                                                                                        | ErrorHandler<Worker>
                                                                                                                                                                                                                        | ExitHandler<Worker>
                                                                                                                                                                                                                        | MessageHandler<Worker>
                                                                                                                                                                                                                        | OnlineHandler<Worker>

                                                                                                                                                                                                                    Worker event handler.

                                                                                                                                                                                                                    +EventHandler | poolifier - v5.1.7
                                                                                                                                                                                                                    poolifier - v5.1.7
                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                      Type Alias EventHandler<Worker>

                                                                                                                                                                                                                      EventHandler:
                                                                                                                                                                                                                          | ErrorHandler<Worker>
                                                                                                                                                                                                                          | ExitHandler<Worker>
                                                                                                                                                                                                                          | MessageHandler<Worker>
                                                                                                                                                                                                                          | OnlineHandler<Worker>

                                                                                                                                                                                                                      Worker event handler.

                                                                                                                                                                                                                      Type Parameters

                                                                                                                                                                                                                      • Worker extends IWorker

                                                                                                                                                                                                                        Type of worker.

                                                                                                                                                                                                                        -
                                                                                                                                                                                                                      +
                                                                                                                                                                                                                      diff --git a/docs/types/src.ExitHandler.html b/docs/types/src.ExitHandler.html index ab19ce1cd..ea71dbe0a 100644 --- a/docs/types/src.ExitHandler.html +++ b/docs/types/src.ExitHandler.html @@ -1,3 +1,3 @@ -ExitHandler | poolifier - v5.1.6
                                                                                                                                                                                                                      poolifier - v5.1.6
                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                        Type Alias ExitHandler<Worker>

                                                                                                                                                                                                                        ExitHandler: (this: Worker, exitCode: number) => void

                                                                                                                                                                                                                        Callback invoked when the worker exits successfully.

                                                                                                                                                                                                                        +ExitHandler | poolifier - v5.1.7
                                                                                                                                                                                                                        poolifier - v5.1.7
                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                          Type Alias ExitHandler<Worker>

                                                                                                                                                                                                                          ExitHandler: (this: Worker, exitCode: number) => void

                                                                                                                                                                                                                          Callback invoked when the worker exits successfully.

                                                                                                                                                                                                                          Type Parameters

                                                                                                                                                                                                                          • Worker extends IWorker

                                                                                                                                                                                                                            Type of worker.

                                                                                                                                                                                                                            -

                                                                                                                                                                                                                          Type Declaration

                                                                                                                                                                                                                            • (this: Worker, exitCode: number): void
                                                                                                                                                                                                                            • Parameters

                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                          +

                                                                                                                                                                                                                          Type Declaration

                                                                                                                                                                                                                            • (this: Worker, exitCode: number): void
                                                                                                                                                                                                                            • Parameters

                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                          diff --git a/docs/types/src.KillBehavior.html b/docs/types/src.KillBehavior.html index cf94f1b69..519faf696 100644 --- a/docs/types/src.KillBehavior.html +++ b/docs/types/src.KillBehavior.html @@ -1,2 +1,2 @@ -KillBehavior | poolifier - v5.1.6
                                                                                                                                                                                                                          poolifier - v5.1.6
                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                            Type Alias KillBehavior

                                                                                                                                                                                                                            KillBehavior: keyof typeof KillBehaviors

                                                                                                                                                                                                                            Kill behavior.

                                                                                                                                                                                                                            -
                                                                                                                                                                                                                            +KillBehavior | poolifier - v5.1.7
                                                                                                                                                                                                                            poolifier - v5.1.7
                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                              Type Alias KillBehavior

                                                                                                                                                                                                                              KillBehavior: keyof typeof KillBehaviors

                                                                                                                                                                                                                              Kill behavior.

                                                                                                                                                                                                                              +
                                                                                                                                                                                                                              diff --git a/docs/types/src.KillHandler.html b/docs/types/src.KillHandler.html index d59f9fcfd..c55130f8c 100644 --- a/docs/types/src.KillHandler.html +++ b/docs/types/src.KillHandler.html @@ -1,2 +1,2 @@ -KillHandler | poolifier - v5.1.6
                                                                                                                                                                                                                              poolifier - v5.1.6
                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                Type Alias KillHandler

                                                                                                                                                                                                                                KillHandler: () => Promise<void> | void

                                                                                                                                                                                                                                Handler called when a worker is killed.

                                                                                                                                                                                                                                -

                                                                                                                                                                                                                                Type Declaration

                                                                                                                                                                                                                                  • (): Promise<void> | void
                                                                                                                                                                                                                                  • Returns Promise<void> | void

                                                                                                                                                                                                                                +KillHandler | poolifier - v5.1.7
                                                                                                                                                                                                                                poolifier - v5.1.7
                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                  Type Alias KillHandler

                                                                                                                                                                                                                                  KillHandler: () => Promise<void> | void

                                                                                                                                                                                                                                  Handler called when a worker is killed.

                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                  Type Declaration

                                                                                                                                                                                                                                    • (): Promise<void> | void
                                                                                                                                                                                                                                    • Returns Promise<void> | void

                                                                                                                                                                                                                                  diff --git a/docs/types/src.Measurement.html b/docs/types/src.Measurement.html index ace888941..4d12a4561 100644 --- a/docs/types/src.Measurement.html +++ b/docs/types/src.Measurement.html @@ -1,2 +1,2 @@ -Measurement | poolifier - v5.1.6
                                                                                                                                                                                                                                  poolifier - v5.1.6
                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                    Type Alias Measurement

                                                                                                                                                                                                                                    Measurement: keyof typeof Measurements

                                                                                                                                                                                                                                    Measurement.

                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                    +Measurement | poolifier - v5.1.7
                                                                                                                                                                                                                                    poolifier - v5.1.7
                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                      Type Alias Measurement

                                                                                                                                                                                                                                      Measurement: keyof typeof Measurements

                                                                                                                                                                                                                                      Measurement.

                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                      diff --git a/docs/types/src.MessageHandler.html b/docs/types/src.MessageHandler.html index 6698c15da..9cc759aa7 100644 --- a/docs/types/src.MessageHandler.html +++ b/docs/types/src.MessageHandler.html @@ -1,3 +1,3 @@ -MessageHandler | poolifier - v5.1.6
                                                                                                                                                                                                                                      poolifier - v5.1.6
                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                        Type Alias MessageHandler<Worker>

                                                                                                                                                                                                                                        MessageHandler: (this: Worker, message: unknown) => void

                                                                                                                                                                                                                                        Callback invoked if the worker has received a message.

                                                                                                                                                                                                                                        +MessageHandler | poolifier - v5.1.7
                                                                                                                                                                                                                                        poolifier - v5.1.7
                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                          Type Alias MessageHandler<Worker>

                                                                                                                                                                                                                                          MessageHandler: (this: Worker, message: unknown) => void

                                                                                                                                                                                                                                          Callback invoked if the worker has received a message.

                                                                                                                                                                                                                                          Type Parameters

                                                                                                                                                                                                                                          • Worker extends IWorker

                                                                                                                                                                                                                                            Type of worker.

                                                                                                                                                                                                                                            -

                                                                                                                                                                                                                                          Type Declaration

                                                                                                                                                                                                                                            • (this: Worker, message: unknown): void
                                                                                                                                                                                                                                            • Parameters

                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                          Type Declaration

                                                                                                                                                                                                                                            • (this: Worker, message: unknown): void
                                                                                                                                                                                                                                            • Parameters

                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                          diff --git a/docs/types/src.OnlineHandler.html b/docs/types/src.OnlineHandler.html index 3d8e47b19..e4ec479ea 100644 --- a/docs/types/src.OnlineHandler.html +++ b/docs/types/src.OnlineHandler.html @@ -1,3 +1,3 @@ -OnlineHandler | poolifier - v5.1.6
                                                                                                                                                                                                                                          poolifier - v5.1.6
                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                            Type Alias OnlineHandler<Worker>

                                                                                                                                                                                                                                            OnlineHandler: (this: Worker) => void

                                                                                                                                                                                                                                            Callback invoked when the worker has started successfully.

                                                                                                                                                                                                                                            +OnlineHandler | poolifier - v5.1.7
                                                                                                                                                                                                                                            poolifier - v5.1.7
                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                              Type Alias OnlineHandler<Worker>

                                                                                                                                                                                                                                              OnlineHandler: (this: Worker) => void

                                                                                                                                                                                                                                              Callback invoked when the worker has started successfully.

                                                                                                                                                                                                                                              Type Parameters

                                                                                                                                                                                                                                              • Worker extends IWorker

                                                                                                                                                                                                                                                Type of worker.

                                                                                                                                                                                                                                                -

                                                                                                                                                                                                                                              Type Declaration

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Type Declaration

                                                                                                                                                                                                                                              diff --git a/docs/types/src.PoolEvent.html b/docs/types/src.PoolEvent.html index 659a16163..897557dbe 100644 --- a/docs/types/src.PoolEvent.html +++ b/docs/types/src.PoolEvent.html @@ -1,2 +1,2 @@ -PoolEvent | poolifier - v5.1.6
                                                                                                                                                                                                                                              poolifier - v5.1.6
                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                Type Alias PoolEvent

                                                                                                                                                                                                                                                PoolEvent: keyof typeof PoolEvents

                                                                                                                                                                                                                                                Pool event.

                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                +PoolEvent | poolifier - v5.1.7
                                                                                                                                                                                                                                                poolifier - v5.1.7
                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                  Type Alias PoolEvent

                                                                                                                                                                                                                                                  PoolEvent: keyof typeof PoolEvents

                                                                                                                                                                                                                                                  Pool event.

                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                  diff --git a/docs/types/src.PoolType.html b/docs/types/src.PoolType.html index 0f46bcee7..2e3fd6caf 100644 --- a/docs/types/src.PoolType.html +++ b/docs/types/src.PoolType.html @@ -1,2 +1,2 @@ -PoolType | poolifier - v5.1.6
                                                                                                                                                                                                                                                  poolifier - v5.1.6
                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                    Type Alias PoolType

                                                                                                                                                                                                                                                    PoolType: keyof typeof PoolTypes

                                                                                                                                                                                                                                                    Pool type.

                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                    +PoolType | poolifier - v5.1.7
                                                                                                                                                                                                                                                    poolifier - v5.1.7
                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                      Type Alias PoolType

                                                                                                                                                                                                                                                      PoolType: keyof typeof PoolTypes

                                                                                                                                                                                                                                                      Pool type.

                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                      diff --git a/docs/types/src.TaskAsyncFunction.html b/docs/types/src.TaskAsyncFunction.html index 84ce1ca52..adb9e21b1 100644 --- a/docs/types/src.TaskAsyncFunction.html +++ b/docs/types/src.TaskAsyncFunction.html @@ -1,7 +1,7 @@ -TaskAsyncFunction | poolifier - v5.1.6
                                                                                                                                                                                                                                                      poolifier - v5.1.6
                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                        Type Alias TaskAsyncFunction<Data, Response>

                                                                                                                                                                                                                                                        TaskAsyncFunction: (data?: Data) => Promise<Response>

                                                                                                                                                                                                                                                        Task asynchronous function that can be executed. +TaskAsyncFunction | poolifier - v5.1.7

                                                                                                                                                                                                                                                        poolifier - v5.1.7
                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                          Type Alias TaskAsyncFunction<Data, Response>

                                                                                                                                                                                                                                                          TaskAsyncFunction: (data?: Data) => Promise<Response>

                                                                                                                                                                                                                                                          Task asynchronous function that can be executed. This function must return a promise.

                                                                                                                                                                                                                                                          Type Parameters

                                                                                                                                                                                                                                                          • Data = unknown

                                                                                                                                                                                                                                                            Type of data sent to the worker. This can only be structured-cloneable data.

                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                          • Response = unknown

                                                                                                                                                                                                                                                            Type of execution response. This can only be structured-cloneable data.

                                                                                                                                                                                                                                                            -

                                                                                                                                                                                                                                                          Type Declaration

                                                                                                                                                                                                                                                            • (data?: Data): Promise<Response>
                                                                                                                                                                                                                                                            • Parameters

                                                                                                                                                                                                                                                              • Optionaldata: Data

                                                                                                                                                                                                                                                                Data sent to the worker.

                                                                                                                                                                                                                                                                -

                                                                                                                                                                                                                                                              Returns Promise<Response>

                                                                                                                                                                                                                                                              Execution response promise.

                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                        • Response = unknown

                                                                                                                                                                                                                                                          Type of execution response. This can only be structured-cloneable data.

                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                        • Type Declaration

                                                                                                                                                                                                                                                            • (data?: Data): Promise<Response>
                                                                                                                                                                                                                                                            • Parameters

                                                                                                                                                                                                                                                              • Optionaldata: Data

                                                                                                                                                                                                                                                                Data sent to the worker.

                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                              Returns Promise<Response>

                                                                                                                                                                                                                                                              Execution response promise.

                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                          diff --git a/docs/types/src.TaskFunction.html b/docs/types/src.TaskFunction.html index aae7f5492..c7b31aadc 100644 --- a/docs/types/src.TaskFunction.html +++ b/docs/types/src.TaskFunction.html @@ -1,5 +1,5 @@ -TaskFunction | poolifier - v5.1.6
                                                                                                                                                                                                                                                          poolifier - v5.1.6
                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                            Type Alias TaskFunction<Data, Response>

                                                                                                                                                                                                                                                            TaskFunction:
                                                                                                                                                                                                                                                                | TaskAsyncFunction<Data, Response>
                                                                                                                                                                                                                                                                | TaskSyncFunction<Data, Response>

                                                                                                                                                                                                                                                            Task function that can be executed. +TaskFunction | poolifier - v5.1.7

                                                                                                                                                                                                                                                            poolifier - v5.1.7
                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                              Type Alias TaskFunction<Data, Response>

                                                                                                                                                                                                                                                              TaskFunction:
                                                                                                                                                                                                                                                                  | TaskAsyncFunction<Data, Response>
                                                                                                                                                                                                                                                                  | TaskSyncFunction<Data, Response>

                                                                                                                                                                                                                                                              Task function that can be executed. This function can be synchronous or asynchronous.

                                                                                                                                                                                                                                                              Type Parameters

                                                                                                                                                                                                                                                              • Data = unknown

                                                                                                                                                                                                                                                                Type of data sent to the worker. This can only be structured-cloneable data.

                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              • Response = unknown

                                                                                                                                                                                                                                                                Type of execution response. This can only be structured-cloneable data.

                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                            • Response = unknown

                                                                                                                                                                                                                                                              Type of execution response. This can only be structured-cloneable data.

                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                            • diff --git a/docs/types/src.TaskFunctions.html b/docs/types/src.TaskFunctions.html index 2ccfcc9e0..1d6e62d6e 100644 --- a/docs/types/src.TaskFunctions.html +++ b/docs/types/src.TaskFunctions.html @@ -1,6 +1,6 @@ -TaskFunctions | poolifier - v5.1.6
                                                                                                                                                                                                                                                              poolifier - v5.1.6
                                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                                Type Alias TaskFunctions<Data, Response>

                                                                                                                                                                                                                                                                TaskFunctions: Record<
                                                                                                                                                                                                                                                                    string,
                                                                                                                                                                                                                                                                    TaskFunction<Data, Response>
                                                                                                                                                                                                                                                                    | TaskFunctionObject<Data, Response>,
                                                                                                                                                                                                                                                                >

                                                                                                                                                                                                                                                                Tasks functions that can be executed. +TaskFunctions | poolifier - v5.1.7

                                                                                                                                                                                                                                                                poolifier - v5.1.7
                                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                                  Type Alias TaskFunctions<Data, Response>

                                                                                                                                                                                                                                                                  TaskFunctions: Record<
                                                                                                                                                                                                                                                                      string,
                                                                                                                                                                                                                                                                      TaskFunction<Data, Response>
                                                                                                                                                                                                                                                                      | TaskFunctionObject<Data, Response>,
                                                                                                                                                                                                                                                                  >

                                                                                                                                                                                                                                                                  Tasks functions that can be executed. The key is the name of the task function or task function object. The value is the task function or task function object.

                                                                                                                                                                                                                                                                  Type Parameters

                                                                                                                                                                                                                                                                  • Data = unknown

                                                                                                                                                                                                                                                                    Type of data sent to the worker. This can only be structured-cloneable data.

                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                  • Response = unknown

                                                                                                                                                                                                                                                                    Type of execution response. This can only be structured-cloneable data.

                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                • Response = unknown

                                                                                                                                                                                                                                                                  Type of execution response. This can only be structured-cloneable data.

                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                • diff --git a/docs/types/src.TaskSyncFunction.html b/docs/types/src.TaskSyncFunction.html index f262133f9..80168cd52 100644 --- a/docs/types/src.TaskSyncFunction.html +++ b/docs/types/src.TaskSyncFunction.html @@ -1,6 +1,6 @@ -TaskSyncFunction | poolifier - v5.1.6
                                                                                                                                                                                                                                                                  poolifier - v5.1.6
                                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                                    Type Alias TaskSyncFunction<Data, Response>

                                                                                                                                                                                                                                                                    TaskSyncFunction: (data?: Data) => Response

                                                                                                                                                                                                                                                                    Task synchronous function that can be executed.

                                                                                                                                                                                                                                                                    +TaskSyncFunction | poolifier - v5.1.7
                                                                                                                                                                                                                                                                    poolifier - v5.1.7
                                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                                      Type Alias TaskSyncFunction<Data, Response>

                                                                                                                                                                                                                                                                      TaskSyncFunction: (data?: Data) => Response

                                                                                                                                                                                                                                                                      Task synchronous function that can be executed.

                                                                                                                                                                                                                                                                      Type Parameters

                                                                                                                                                                                                                                                                      • Data = unknown

                                                                                                                                                                                                                                                                        Type of data sent to the worker. This can only be structured-cloneable data.

                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                      • Response = unknown

                                                                                                                                                                                                                                                                        Type of execution response. This can only be structured-cloneable data.

                                                                                                                                                                                                                                                                        -

                                                                                                                                                                                                                                                                      Type Declaration

                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                    • Response = unknown

                                                                                                                                                                                                                                                                      Type of execution response. This can only be structured-cloneable data.

                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                    • Type Declaration

                                                                                                                                                                                                                                                                      diff --git a/docs/types/src.ThreadPoolOptions.html b/docs/types/src.ThreadPoolOptions.html index c7f9fcd6c..63e27f771 100644 --- a/docs/types/src.ThreadPoolOptions.html +++ b/docs/types/src.ThreadPoolOptions.html @@ -1,2 +1,2 @@ -ThreadPoolOptions | poolifier - v5.1.6
                                                                                                                                                                                                                                                                      poolifier - v5.1.6
                                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                                        Type Alias ThreadPoolOptions

                                                                                                                                                                                                                                                                        ThreadPoolOptions: PoolOptions<Worker>

                                                                                                                                                                                                                                                                        Options for a poolifier thread pool.

                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                        +ThreadPoolOptions | poolifier - v5.1.7
                                                                                                                                                                                                                                                                        poolifier - v5.1.7
                                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                                          Type Alias ThreadPoolOptions

                                                                                                                                                                                                                                                                          ThreadPoolOptions: PoolOptions<Worker>

                                                                                                                                                                                                                                                                          Options for a poolifier thread pool.

                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                          diff --git a/docs/types/src.WorkerChoiceStrategy.html b/docs/types/src.WorkerChoiceStrategy.html index 2b66de8e3..ac5123b79 100644 --- a/docs/types/src.WorkerChoiceStrategy.html +++ b/docs/types/src.WorkerChoiceStrategy.html @@ -1,2 +1,2 @@ -WorkerChoiceStrategy | poolifier - v5.1.6
                                                                                                                                                                                                                                                                          poolifier - v5.1.6
                                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                                            Type Alias WorkerChoiceStrategy

                                                                                                                                                                                                                                                                            WorkerChoiceStrategy: keyof typeof WorkerChoiceStrategies

                                                                                                                                                                                                                                                                            Worker choice strategy.

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            +WorkerChoiceStrategy | poolifier - v5.1.7
                                                                                                                                                                                                                                                                            poolifier - v5.1.7
                                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                                              Type Alias WorkerChoiceStrategy

                                                                                                                                                                                                                                                                              WorkerChoiceStrategy: keyof typeof WorkerChoiceStrategies

                                                                                                                                                                                                                                                                              Worker choice strategy.

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              diff --git a/docs/types/src.WorkerType.html b/docs/types/src.WorkerType.html index e65eb678f..1e8f6288a 100644 --- a/docs/types/src.WorkerType.html +++ b/docs/types/src.WorkerType.html @@ -1,2 +1,2 @@ -WorkerType | poolifier - v5.1.6
                                                                                                                                                                                                                                                                              poolifier - v5.1.6
                                                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                                                Type Alias WorkerType

                                                                                                                                                                                                                                                                                WorkerType: keyof typeof WorkerTypes

                                                                                                                                                                                                                                                                                Worker type.

                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                +WorkerType | poolifier - v5.1.7
                                                                                                                                                                                                                                                                                poolifier - v5.1.7
                                                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                                                  Type Alias WorkerType

                                                                                                                                                                                                                                                                                  WorkerType: keyof typeof WorkerTypes

                                                                                                                                                                                                                                                                                  Worker type.

                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                  diff --git a/docs/types/src.Writable.html b/docs/types/src.Writable.html index 0e47282ce..8a4af113f 100644 --- a/docs/types/src.Writable.html +++ b/docs/types/src.Writable.html @@ -1,3 +1,3 @@ -Writable | poolifier - v5.1.6
                                                                                                                                                                                                                                                                                  poolifier - v5.1.6
                                                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                                                    Type Alias Writable<T>Internal

                                                                                                                                                                                                                                                                                    Writable: { -readonly [P in keyof T]: T[P] }

                                                                                                                                                                                                                                                                                    Remove readonly modifier from all properties of T.

                                                                                                                                                                                                                                                                                    +Writable | poolifier - v5.1.7
                                                                                                                                                                                                                                                                                    poolifier - v5.1.7
                                                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                                                      Type Alias Writable<T>Internal

                                                                                                                                                                                                                                                                                      Writable: { -readonly [P in keyof T]: T[P] }

                                                                                                                                                                                                                                                                                      Remove readonly modifier from all properties of T.

                                                                                                                                                                                                                                                                                      Type Parameters

                                                                                                                                                                                                                                                                                      • T

                                                                                                                                                                                                                                                                                        Type to remove readonly modifier.

                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                      diff --git a/docs/variables/src.KillBehaviors.html b/docs/variables/src.KillBehaviors.html index 9428a6f61..e8be489e9 100644 --- a/docs/variables/src.KillBehaviors.html +++ b/docs/variables/src.KillBehaviors.html @@ -1,2 +1,2 @@ -KillBehaviors | poolifier - v5.1.6
                                                                                                                                                                                                                                                                                      poolifier - v5.1.6
                                                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                                                        Variable KillBehaviorsConst

                                                                                                                                                                                                                                                                                        KillBehaviors: Readonly<{ HARD: "HARD"; SOFT: "SOFT" }> = ...

                                                                                                                                                                                                                                                                                        Enumeration of kill behaviors.

                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        +KillBehaviors | poolifier - v5.1.7
                                                                                                                                                                                                                                                                                        poolifier - v5.1.7
                                                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                                                          Variable KillBehaviorsConst

                                                                                                                                                                                                                                                                                          KillBehaviors: Readonly<{ HARD: "HARD"; SOFT: "SOFT" }> = ...

                                                                                                                                                                                                                                                                                          Enumeration of kill behaviors.

                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                          diff --git a/docs/variables/src.Measurements.html b/docs/variables/src.Measurements.html index d9886fc60..3ed5573c2 100644 --- a/docs/variables/src.Measurements.html +++ b/docs/variables/src.Measurements.html @@ -1,2 +1,2 @@ -Measurements | poolifier - v5.1.6
                                                                                                                                                                                                                                                                                          poolifier - v5.1.6
                                                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                                                            Variable MeasurementsConst

                                                                                                                                                                                                                                                                                            Measurements: Readonly<{ elu: "elu"; runTime: "runTime"; waitTime: "waitTime" }> = ...

                                                                                                                                                                                                                                                                                            Enumeration of measurements.

                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                            +Measurements | poolifier - v5.1.7
                                                                                                                                                                                                                                                                                            poolifier - v5.1.7
                                                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                                                              Variable MeasurementsConst

                                                                                                                                                                                                                                                                                              Measurements: Readonly<{ elu: "elu"; runTime: "runTime"; waitTime: "waitTime" }> = ...

                                                                                                                                                                                                                                                                                              Enumeration of measurements.

                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                              diff --git a/docs/variables/src.PoolEvents.html b/docs/variables/src.PoolEvents.html index 00f7808ae..c5fbecd2f 100644 --- a/docs/variables/src.PoolEvents.html +++ b/docs/variables/src.PoolEvents.html @@ -1,2 +1,2 @@ -PoolEvents | poolifier - v5.1.6
                                                                                                                                                                                                                                                                                              poolifier - v5.1.6
                                                                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                                                                Variable PoolEventsConst

                                                                                                                                                                                                                                                                                                PoolEvents: Readonly<
                                                                                                                                                                                                                                                                                                    {
                                                                                                                                                                                                                                                                                                        backPressure: "backPressure";
                                                                                                                                                                                                                                                                                                        backPressureEnd: "backPressureEnd";
                                                                                                                                                                                                                                                                                                        busy: "busy";
                                                                                                                                                                                                                                                                                                        busyEnd: "busyEnd";
                                                                                                                                                                                                                                                                                                        destroy: "destroy";
                                                                                                                                                                                                                                                                                                        empty: "empty";
                                                                                                                                                                                                                                                                                                        error: "error";
                                                                                                                                                                                                                                                                                                        full: "full";
                                                                                                                                                                                                                                                                                                        fullEnd: "fullEnd";
                                                                                                                                                                                                                                                                                                        ready: "ready";
                                                                                                                                                                                                                                                                                                        taskError: "taskError";
                                                                                                                                                                                                                                                                                                    },
                                                                                                                                                                                                                                                                                                > = ...

                                                                                                                                                                                                                                                                                                Enumeration of pool events.

                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                +PoolEvents | poolifier - v5.1.7
                                                                                                                                                                                                                                                                                                poolifier - v5.1.7
                                                                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                                                                  Variable PoolEventsConst

                                                                                                                                                                                                                                                                                                  PoolEvents: Readonly<
                                                                                                                                                                                                                                                                                                      {
                                                                                                                                                                                                                                                                                                          backPressure: "backPressure";
                                                                                                                                                                                                                                                                                                          backPressureEnd: "backPressureEnd";
                                                                                                                                                                                                                                                                                                          busy: "busy";
                                                                                                                                                                                                                                                                                                          busyEnd: "busyEnd";
                                                                                                                                                                                                                                                                                                          destroy: "destroy";
                                                                                                                                                                                                                                                                                                          empty: "empty";
                                                                                                                                                                                                                                                                                                          error: "error";
                                                                                                                                                                                                                                                                                                          full: "full";
                                                                                                                                                                                                                                                                                                          fullEnd: "fullEnd";
                                                                                                                                                                                                                                                                                                          ready: "ready";
                                                                                                                                                                                                                                                                                                          taskError: "taskError";
                                                                                                                                                                                                                                                                                                      },
                                                                                                                                                                                                                                                                                                  > = ...

                                                                                                                                                                                                                                                                                                  Enumeration of pool events.

                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                  diff --git a/docs/variables/src.PoolTypes.html b/docs/variables/src.PoolTypes.html index 4ed3f4bb5..b1042e74a 100644 --- a/docs/variables/src.PoolTypes.html +++ b/docs/variables/src.PoolTypes.html @@ -1,2 +1,2 @@ -PoolTypes | poolifier - v5.1.6
                                                                                                                                                                                                                                                                                                  poolifier - v5.1.6
                                                                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                                                                    Variable PoolTypesConst

                                                                                                                                                                                                                                                                                                    PoolTypes: Readonly<{ dynamic: "dynamic"; fixed: "fixed" }> = ...

                                                                                                                                                                                                                                                                                                    Enumeration of pool types.

                                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                                    +PoolTypes | poolifier - v5.1.7
                                                                                                                                                                                                                                                                                                    poolifier - v5.1.7
                                                                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                                                                      Variable PoolTypesConst

                                                                                                                                                                                                                                                                                                      PoolTypes: Readonly<{ dynamic: "dynamic"; fixed: "fixed" }> = ...

                                                                                                                                                                                                                                                                                                      Enumeration of pool types.

                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                      diff --git a/docs/variables/src.WorkerChoiceStrategies.html b/docs/variables/src.WorkerChoiceStrategies.html index 50a10a8b6..d4667e549 100644 --- a/docs/variables/src.WorkerChoiceStrategies.html +++ b/docs/variables/src.WorkerChoiceStrategies.html @@ -1,2 +1,2 @@ -WorkerChoiceStrategies | poolifier - v5.1.6
                                                                                                                                                                                                                                                                                                      poolifier - v5.1.6
                                                                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                                                                        Variable WorkerChoiceStrategiesConst

                                                                                                                                                                                                                                                                                                        WorkerChoiceStrategies: Readonly<
                                                                                                                                                                                                                                                                                                            {
                                                                                                                                                                                                                                                                                                                FAIR_SHARE: "FAIR_SHARE";
                                                                                                                                                                                                                                                                                                                INTERLEAVED_WEIGHTED_ROUND_ROBIN: "INTERLEAVED_WEIGHTED_ROUND_ROBIN";
                                                                                                                                                                                                                                                                                                                LEAST_BUSY: "LEAST_BUSY";
                                                                                                                                                                                                                                                                                                                LEAST_ELU: "LEAST_ELU";
                                                                                                                                                                                                                                                                                                                LEAST_USED: "LEAST_USED";
                                                                                                                                                                                                                                                                                                                ROUND_ROBIN: "ROUND_ROBIN";
                                                                                                                                                                                                                                                                                                                WEIGHTED_ROUND_ROBIN: "WEIGHTED_ROUND_ROBIN";
                                                                                                                                                                                                                                                                                                            },
                                                                                                                                                                                                                                                                                                        > = ...

                                                                                                                                                                                                                                                                                                        Enumeration of worker choice strategies.

                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                        +WorkerChoiceStrategies | poolifier - v5.1.7
                                                                                                                                                                                                                                                                                                        poolifier - v5.1.7
                                                                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                                                                          Variable WorkerChoiceStrategiesConst

                                                                                                                                                                                                                                                                                                          WorkerChoiceStrategies: Readonly<
                                                                                                                                                                                                                                                                                                              {
                                                                                                                                                                                                                                                                                                                  FAIR_SHARE: "FAIR_SHARE";
                                                                                                                                                                                                                                                                                                                  INTERLEAVED_WEIGHTED_ROUND_ROBIN: "INTERLEAVED_WEIGHTED_ROUND_ROBIN";
                                                                                                                                                                                                                                                                                                                  LEAST_BUSY: "LEAST_BUSY";
                                                                                                                                                                                                                                                                                                                  LEAST_ELU: "LEAST_ELU";
                                                                                                                                                                                                                                                                                                                  LEAST_USED: "LEAST_USED";
                                                                                                                                                                                                                                                                                                                  ROUND_ROBIN: "ROUND_ROBIN";
                                                                                                                                                                                                                                                                                                                  WEIGHTED_ROUND_ROBIN: "WEIGHTED_ROUND_ROBIN";
                                                                                                                                                                                                                                                                                                              },
                                                                                                                                                                                                                                                                                                          > = ...

                                                                                                                                                                                                                                                                                                          Enumeration of worker choice strategies.

                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                          diff --git a/docs/variables/src.WorkerTypes.html b/docs/variables/src.WorkerTypes.html index bed89547f..73e32e9b0 100644 --- a/docs/variables/src.WorkerTypes.html +++ b/docs/variables/src.WorkerTypes.html @@ -1,2 +1,2 @@ -WorkerTypes | poolifier - v5.1.6
                                                                                                                                                                                                                                                                                                          poolifier - v5.1.6
                                                                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                                                                            Variable WorkerTypesConst

                                                                                                                                                                                                                                                                                                            WorkerTypes: Readonly<{ cluster: "cluster"; thread: "thread" }> = ...

                                                                                                                                                                                                                                                                                                            Enumeration of worker types.

                                                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                                                            +WorkerTypes | poolifier - v5.1.7
                                                                                                                                                                                                                                                                                                            poolifier - v5.1.7
                                                                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                                                                              Variable WorkerTypesConst

                                                                                                                                                                                                                                                                                                              WorkerTypes: Readonly<{ cluster: "cluster"; thread: "thread" }> = ...

                                                                                                                                                                                                                                                                                                              Enumeration of worker types.

                                                                                                                                                                                                                                                                                                              +