From: Documentation Bot Date: Thu, 11 Jul 2024 17:27:20 +0000 (+0000) Subject: docs: publish documentation X-Git-Tag: v4.1.0~18 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=082fb4db638f093fe284690eaf4764e0a2758184;p=poolifier.git docs: publish documentation --- diff --git a/docs/assets/main.js b/docs/assets/main.js index 7d7f77a0..35728810 100644 --- a/docs/assets/main.js +++ b/docs/assets/main.js @@ -1,9 +1,9 @@ "use strict"; window.translations={"copy":"Copy","copied":"Copied!","normally_hidden":"This member is normally hidden due to your filter settings."}; -"use strict";(()=>{var Ce=Object.create;var ie=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var Re=Object.getPrototypeOf,Me=Object.prototype.hasOwnProperty;var Fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var De=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _e(e))!Me.call(t,i)&&i!==n&&ie(t,i,{get:()=>e[i],enumerable:!(r=Oe(e,i))||r.enumerable});return t};var Ae=(t,e,n)=>(n=t!=null?Ce(Re(t)):{},De(e||!t||!t.__esModule?ie(n,"default",{value:t,enumerable:!0}):n,t));var ue=Fe((ae,le)=>{(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,u],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(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=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 l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,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 u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),p;m in s.node.edges?p=s.node.edges[m]:(p=new t.TokenSet,s.node.edges[m]=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),l=0;l1?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 ae=="object"?le.exports=n():e.lunr=n()}(this,function(){return t})})()});var se=[];function G(t,e){se.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;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){se.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&&!e.checkVisibility()){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").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)})})}};var oe=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var pe=Ae(ue());async function ce(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=pe.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function fe(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{ce(e,t)}),ce(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");i.addEventListener("mouseup",()=>{te(t)}),r.addEventListener("focus",()=>t.classList.add("has-focus")),Ve(t,i,r,e)}function Ve(t,e,n,r){n.addEventListener("input",oe(()=>{Ne(t,e,n,r)},200)),n.addEventListener("keydown",i=>{i.key=="Enter"?He(e,t):i.key=="ArrowUp"?(de(e,n,-1),i.preventDefault()):i.key==="ArrowDown"&&(de(e,n,1),i.preventDefault())}),document.body.addEventListener("keypress",i=>{i.altKey||i.ctrlKey||i.metaKey||!n.matches(":focus")&&i.key==="/"&&(i.preventDefault(),n.focus())}),document.body.addEventListener("keyup",i=>{t.classList.contains("has-focus")&&(i.key==="Escape"||!e.matches(":focus-within")&&!n.matches(":focus"))&&(n.blur(),te(t))})}function te(t){t.classList.remove("has-focus")}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=he(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` - ${he(l.parent,i)}.${d}`);let m=document.createElement("li");m.classList.value=l.classes??"";let p=document.createElement("a");p.href=r.base+l.url,p.innerHTML=u+d,m.append(p),p.addEventListener("focus",()=>{e.querySelector(".current")?.classList.remove("current"),m.classList.add("current")}),e.appendChild(m)}}function de(t,e,n){let r=t.querySelector(".current");if(!r)r=t.querySelector(n==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let i=r;if(n===1)do i=i.nextElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);else do i=i.previousElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);i?(r.classList.remove("current"),i.classList.add("current")):n===-1&&(r.classList.remove("current"),e.focus())}}function He(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),te(e)}}function he(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(ee(t.substring(s,o)),`${ee(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(ee(t.substring(s))),i.join("")}var Be={"&":"&","<":"<",">":">","'":"'",'"':"""};function ee(t){return t.replace(/[&<>"'"]/g,e=>Be[e])}var I=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",ye="mousemove",H="mouseup",J={x:0,y:0},me=!1,ne=!1,je=!1,D=!1,ve=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(ve?"is-mobile":"not-mobile");ve&&"ontouchstart"in document.documentElement&&(je=!0,F="touchstart",ye="touchmove",H="touchend");document.addEventListener(F,t=>{ne=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(ye,t=>{if(ne&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(H,()=>{ne=!1});document.addEventListener("click",t=>{me&&(t.preventDefault(),t.stopImmediatePropagation(),me=!1)});var X=class extends I{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(H,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(H,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){D||(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(!D&&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 re;try{re=localStorage}catch{re={getItem(){return null},setItem(){}}}var Q=re;var ge=document.head.appendChild(document.createElement("style"));ge.dataset.for="filters";var Y=class extends I{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()),ge.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } -`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=Q.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){Q.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),this.app.updateIndexVisibility()}};var Z=class extends I{constructor(e){super(e),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let r=this.summary.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function Ee(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,xe(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),xe(t.value)})}function xe(t){document.documentElement.dataset.theme=t}var K;function we(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",Le),Le())}async function Le(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();K=t.dataset.base,K.endsWith("/")||(K+="/"),t.innerHTML="";for(let s of i)Se(s,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function Se(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='',be(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)Se(u,l,i)}else be(t,r,t.class)}function be(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=K+t.path,n&&(r.className=n),location.pathname===r.pathname&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Te=document.getElementById("tsd-theme");Te&&Ee(Te);var qe=new U;Object.defineProperty(window,"app",{value:qe});fe();we();})(); +"use strict";(()=>{var Pe=Object.create;var ie=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var Re=Object.getPrototypeOf,Me=Object.prototype.hasOwnProperty;var Fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var De=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _e(e))!Me.call(t,i)&&i!==n&&ie(t,i,{get:()=>e[i],enumerable:!(r=Oe(e,i))||r.enumerable});return t};var Ae=(t,e,n)=>(n=t!=null?Pe(Re(t)):{},De(e||!t||!t.__esModule?ie(n,"default",{value:t,enumerable:!0}):n,t));var ue=Fe((ae,le)=>{(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,u],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(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=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 l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,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 u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),p;m in s.node.edges?p=s.node.edges[m]:(p=new t.TokenSet,s.node.edges[m]=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),l=0;l1?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 ae=="object"?le.exports=n():e.lunr=n()}(this,function(){return t})})()});var se=[];function G(t,e){se.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;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){se.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&&!Ve(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 Ve(t){let e=t.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(e.bottom<0||e.top-n>=0)}var oe=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var pe=Ae(ue());async function ce(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=pe.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function fe(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{ce(e,t)}),ce(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");i.addEventListener("mouseup",()=>{te(t)}),r.addEventListener("focus",()=>t.classList.add("has-focus")),He(t,i,r,e)}function He(t,e,n,r){n.addEventListener("input",oe(()=>{Ne(t,e,n,r)},200)),n.addEventListener("keydown",i=>{i.key=="Enter"?Be(e,t):i.key=="ArrowUp"?(de(e,n,-1),i.preventDefault()):i.key==="ArrowDown"&&(de(e,n,1),i.preventDefault())}),document.body.addEventListener("keypress",i=>{i.altKey||i.ctrlKey||i.metaKey||!n.matches(":focus")&&i.key==="/"&&(i.preventDefault(),n.focus())}),document.body.addEventListener("keyup",i=>{t.classList.contains("has-focus")&&(i.key==="Escape"||!e.matches(":focus-within")&&!n.matches(":focus"))&&(n.blur(),te(t))})}function te(t){t.classList.remove("has-focus")}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=he(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${he(l.parent,i)}.${d}`);let m=document.createElement("li");m.classList.value=l.classes??"";let p=document.createElement("a");p.href=r.base+l.url,p.innerHTML=u+d,m.append(p),p.addEventListener("focus",()=>{e.querySelector(".current")?.classList.remove("current"),m.classList.add("current")}),e.appendChild(m)}}function de(t,e,n){let r=t.querySelector(".current");if(!r)r=t.querySelector(n==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let i=r;if(n===1)do i=i.nextElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);else do i=i.previousElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);i?(r.classList.remove("current"),i.classList.add("current")):n===-1&&(r.classList.remove("current"),e.focus())}}function Be(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),te(e)}}function he(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(ee(t.substring(s,o)),`${ee(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(ee(t.substring(s))),i.join("")}var je={"&":"&","<":"<",">":">","'":"'",'"':"""};function ee(t){return t.replace(/[&<>"'"]/g,e=>je[e])}var I=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",ye="mousemove",N="mouseup",J={x:0,y:0},me=!1,ne=!1,qe=!1,D=!1,ve=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(ve?"is-mobile":"not-mobile");ve&&"ontouchstart"in document.documentElement&&(qe=!0,F="touchstart",ye="touchmove",N="touchend");document.addEventListener(F,t=>{ne=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(ye,t=>{if(ne&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(N,()=>{ne=!1});document.addEventListener("click",t=>{me&&(t.preventDefault(),t.stopImmediatePropagation(),me=!1)});var X=class extends I{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(N,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(N,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){D||(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(!D&&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 re;try{re=localStorage}catch{re={getItem(){return null},setItem(){}}}var Q=re;var ge=document.head.appendChild(document.createElement("style"));ge.dataset.for="filters";var Y=class extends I{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()),ge.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=Q.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){Q.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),this.app.updateIndexVisibility()}};var Z=class extends I{constructor(e){super(e),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let r=this.summary.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function Ee(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,xe(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),xe(t.value)})}function xe(t){document.documentElement.dataset.theme=t}var K;function we(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",Le),Le())}async function Le(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();K=t.dataset.base,K.endsWith("/")||(K+="/"),t.innerHTML="";for(let s of i)Se(s,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function Se(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='',be(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)Se(u,l,i)}else be(t,r,t.class)}function be(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=K+t.path,n&&(r.className=n),location.pathname===r.pathname&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Te=document.getElementById("tsd-theme");Te&&Ee(Te);var $e=new U;Object.defineProperty(window,"app",{value:$e});fe();we();})(); /*! Bundled license information: lunr/lunr.js: diff --git a/docs/classes/AbstractPool.html b/docs/classes/AbstractPool.html index 2f033d01..5c4ff307 100644 --- a/docs/classes/AbstractPool.html +++ b/docs/classes/AbstractPool.html @@ -1,8 +1,8 @@ -AbstractPool | poolifier - v4.0.17

Class AbstractPool<Worker, Data, Response>Abstract

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

+AbstractPool | poolifier - v4.0.18

Class AbstractPool<Worker, Data, Response>Abstract

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

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 full)

Implements

Constructors

Hierarchy (view full)

Implements

Constructors

Properties

  • filePath: string

    Path to the worker file.

  • opts: PoolOptions<Worker>

    Options for the pool.

  • OptionalmaximumNumberOfWorkers: number

    Maximum number of workers that this pool manages.

    -
  • Returns AbstractPool<Worker, Data, Response>

    Properties

    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. +

    Returns AbstractPool<Worker, Data, Response>

    Properties

    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:

      @@ -68,92 +68,92 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'taskError': Emitted when an error occurs while executing a task.
    • 'backPressure': Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size >= maximum queue size).
    -
    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:

    +
    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.

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

    Worker choice strategies context referencing worker choice algorithms implementation.

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

    Pool worker nodes.

    -

    Accessors

    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

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

    Pool worker nodes.

    +

    Accessors

    • get type(): "fixed" | "dynamic"
    • The pool type.

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

      -

      Returns "fixed" | "dynamic"

    Methods

    • Parameters

    Methods

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

      Parameters

      • workerNodeKey: number

        The worker node key.

      • message: MessageValue<Response, unknown>

        The received message.

        -

      Returns void

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

    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.

      +

    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, unknown>) => void)

        The message listener callback.

        -

      Returns void

    • Terminates the worker node given its worker node key.

      +

    Returns void

    • Terminates the worker node given its worker node key.

      Parameters

      • workerNodeKey: number

        The worker node key.

        -

      Returns Promise<void>

    • Parameters

      • Optionaldata: Data

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

        +

      Returns Promise<void>

    • 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.

      • OptionaltransferList: readonly TransferListItem[]

        An 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.

      -
    • Gets the worker information given its worker node key.

      Parameters

      • workerNodeKey: number

        The worker node key.

      Returns undefined | WorkerInfo

      The worker information.

      -
    • 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>

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

        +
    • 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.

      • OptionaltransferList: readonly TransferListItem[]

        An 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.

      -
    • 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, unknown>) => void)

        The message listener callback.

        -

      Returns void

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

      +

    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, unknown>) => void)

        The message listener callback.

        -

      Returns void

    • 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, unknown>

        The message.

      • OptionaltransferList: readonly TransferListItem[]

        The optional array of transferable objects.

        -

      Returns void

    • Parameters

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

      Returns void

    • Parameters

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

      Returns void

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

      -

      Returns void

    • Conditions for dynamic worker creation.

      Returns boolean

      Whether to create a dynamic worker or not.

      -
    \ No newline at end of file +

    Returns void

    diff --git a/docs/classes/AbstractWorker.html b/docs/classes/AbstractWorker.html index dddad3e1..45f8058f 100644 --- a/docs/classes/AbstractWorker.html +++ b/docs/classes/AbstractWorker.html @@ -1,8 +1,8 @@ -AbstractWorker | poolifier - v4.0.17

    Class AbstractWorker<MainWorker, Data, Response>Abstract

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

    +AbstractWorker | poolifier - v4.0.18

    Class AbstractWorker<MainWorker, Data, Response>Abstract

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

    Type Parameters

    • MainWorker extends Worker | MessagePort

      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 full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    activeInterval? id isMain @@ -31,50 +31,50 @@
  • mainWorker: undefined | null | MainWorker

    Reference to main worker.

  • taskFunctions: TaskFunction<Data, Response> | TaskFunctions<Data, Response>

    Task function(s) processed by the worker when the pool's execution function is invoked. The first function is the default function.

  • opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

    Options for the worker.

    -
  • Returns AbstractWorker<MainWorker, Data, Response>

    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.

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

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

    -

    Methods

    Returns AbstractWorker<MainWorker, Data, Response>

    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.

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

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

    +

    Methods

    • Handles an error and convert it to a string so it can be sent back to the main worker.

      Parameters

      • error: string | Error

        The error raised by the worker.

      Returns string

      The error message.

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

      +

    Returns void

    Returns void

    Returns void

    • Runs the given task function asynchronously.

      +

    Returns void

    • Runs the given task function synchronously.

      +

    Returns void

    • Sends a message to main worker.

      +

    Returns void

    Returns void

    \ No newline at end of file +
    diff --git a/docs/classes/CircularBuffer.html b/docs/classes/CircularBuffer.html index 7471ff5b..d5aa8afe 100644 --- a/docs/classes/CircularBuffer.html +++ b/docs/classes/CircularBuffer.html @@ -1,5 +1,5 @@ -CircularBuffer | poolifier - v4.0.17

    Class CircularBufferInternal

    Circular buffer designed for positive numbers.

    -

    Constructors

    constructor +CircularBuffer | poolifier - v4.0.18

    Class CircularBufferInternal

    Circular buffer designed for positive numbers.

    +

    Constructors

    Properties

    Methods

    empty full @@ -11,14 +11,14 @@
    defaultBufferSize
     
    -

    Properties

    size: number

    Methods

    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.

      -
    • Puts number into buffer.

      Parameters

      • number: number

        Number to put into buffer.

        -

      Returns void

    • Returns buffer as numbers' array.

      +

    Returns void

    \ No newline at end of file +
    diff --git a/docs/classes/ClusterWorker.html b/docs/classes/ClusterWorker.html index 5caaec34..424d20cf 100644 --- a/docs/classes/ClusterWorker.html +++ b/docs/classes/ClusterWorker.html @@ -1,4 +1,4 @@ -ClusterWorker | poolifier - v4.0.17

    Class ClusterWorker<Data, Response>

    A cluster worker used by a poolifier ClusterPool.

    +ClusterWorker | poolifier - v4.0.18

    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, @@ -7,7 +7,7 @@ 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 full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

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

    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.

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

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

    -

    Accessors

    Methods

    Returns ClusterWorker<Data, Response>

    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.

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

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

    +

    Accessors

    Methods

    • Handles an error and convert it to a string so it can be sent back to the main worker.

      Parameters

      • error: string | Error

        The error raised by the worker.

      Returns string

      The error message.

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

      +

    Returns void

    Returns void

    Returns void

    • Runs the given task function asynchronously.

      +

    Returns void

    • Runs the given task function synchronously.

      +

    Returns void

    • Sends a message to main worker.

      +

    Returns void

    Returns void

    \ No newline at end of file +
    diff --git a/docs/classes/DynamicClusterPool.html b/docs/classes/DynamicClusterPool.html index 49455e72..e95edd9b 100644 --- a/docs/classes/DynamicClusterPool.html +++ b/docs/classes/DynamicClusterPool.html @@ -1,11 +1,11 @@ -DynamicClusterPool | poolifier - v4.0.17

    Class DynamicClusterPool<Data, Response>

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

    +DynamicClusterPool | poolifier - v4.0.18

    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.

    Christopher Quadflieg

    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 full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    emitter? filePath maximumNumberOfWorkers? @@ -58,7 +58,7 @@ When the maximum number of workers is reached and workers are busy, an event is
  • 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

    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. +

    Returns DynamicClusterPool<Data, Response>

    Properties

    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:

      @@ -71,91 +71,91 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'taskError': Emitted when an error occurs while executing a task.
    • 'backPressure': Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size >= maximum queue size).
    -
    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 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.

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

    Worker choice strategies context referencing worker choice algorithms implementation.

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

    Pool worker nodes.

    -

    Accessors

    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

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

    Pool worker nodes.

    +

    Accessors

    • get busy(): boolean
    • Whether the pool is busy or not.

      Returns boolean

      The pool busyness boolean status.

      -
    • get empty(): boolean
    • Whether the pool is empty or not.

      Returns boolean

      The pool emptiness boolean status.

      -
    • get full(): boolean
    • Whether the pool is full or not.

      Returns boolean

      The pool fullness boolean status.

      -
    • get type(): "fixed" | "dynamic"
    • The pool type.

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

      -

      Returns "fixed" | "dynamic"

    • get worker(): "thread" | "cluster"
    • The worker type.

      -

      Returns "thread" | "cluster"

    Methods

    • Parameters

    • get worker(): "thread" | "cluster"
    • The worker type.

      +

      Returns "thread" | "cluster"

    Methods

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

    Returns void

    • Hook executed before the worker task execution. +

    Returns void

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

      +

    Returns void

    • Terminates the worker node given its worker node key.

      +

    Returns void

    • 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.

      • OptionaltransferList: readonly TransferListItem[]

        An 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.

      -
    • 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.

      • OptionaltransferList: readonly TransferListItem[]

        An 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.

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

      +

    Returns void

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

      +

    Returns void

    • Parameters

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

      Returns void

    • Parameters

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

      Returns void

    \ No newline at end of file +

    Returns void

    diff --git a/docs/classes/DynamicThreadPool.html b/docs/classes/DynamicThreadPool.html index e77932d2..7eee3243 100644 --- a/docs/classes/DynamicThreadPool.html +++ b/docs/classes/DynamicThreadPool.html @@ -1,11 +1,11 @@ -DynamicThreadPool | poolifier - v4.0.17

    Class DynamicThreadPool<Data, Response>

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

    +DynamicThreadPool | poolifier - v4.0.18

    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.

    Alessandro Pio Ardizio

    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 full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    emitter? filePath maximumNumberOfWorkers? @@ -58,7 +58,7 @@ When the maximum number of threads is reached and workers are busy, an event is
  • 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

    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. +

    Returns DynamicThreadPool<Data, Response>

    Properties

    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:

      @@ -71,92 +71,92 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'taskError': Emitted when an error occurs while executing a task.
    • 'backPressure': Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size >= maximum queue size).
    -
    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 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.

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

    Worker choice strategies context referencing worker choice algorithms implementation.

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

    Pool worker nodes.

    -

    Accessors

    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

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

    Pool worker nodes.

    +

    Accessors

    • get busy(): boolean
    • Whether the pool is busy or not.

      Returns boolean

      The pool busyness boolean status.

      -
    • get empty(): boolean
    • Whether the pool is empty or not.

      Returns boolean

      The pool emptiness boolean status.

      -
    • get full(): boolean
    • Whether the pool is full or not.

      Returns boolean

      The pool fullness boolean status.

      -
    • get type(): "fixed" | "dynamic"
    • The pool type.

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

      -

      Returns "fixed" | "dynamic"

    • get worker(): "thread" | "cluster"
    • The worker type.

      -

      Returns "thread" | "cluster"

    Methods

    • Parameters

    • get worker(): "thread" | "cluster"
    • The worker type.

      +

      Returns "thread" | "cluster"

    Methods

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

    Returns void

    • Hook executed before the worker task execution. +

    Returns void

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

      +

    Returns void

    • Terminates the worker node given its worker node key.

      +

    Returns void

    • 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.

      • OptionaltransferList: readonly TransferListItem[]

        An 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.

      -
    • 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.

      • OptionaltransferList: readonly TransferListItem[]

        An 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.

      -
    • Registers a listener callback on the worker given its 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, unknown>

        The message.

      • OptionaltransferList: readonly TransferListItem[]

        The optional array of transferable objects.

        -

      Returns void

    • Parameters

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

      Returns void

    • Parameters

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

      Returns void

    \ No newline at end of file +

    Returns void

    diff --git a/docs/classes/FixedClusterPool.html b/docs/classes/FixedClusterPool.html index 3893f0ac..a5f1d60c 100644 --- a/docs/classes/FixedClusterPool.html +++ b/docs/classes/FixedClusterPool.html @@ -1,9 +1,9 @@ -FixedClusterPool | poolifier - v4.0.17

    Class FixedClusterPool<Data, Response>

    A cluster pool with a fixed number of workers.

    +FixedClusterPool | poolifier - v4.0.18

    Class FixedClusterPool<Data, Response>

    A cluster pool with a fixed number of workers.

    Christopher Quadflieg

    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 full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

  • 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

    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. +

    Returns FixedClusterPool<Data, Response>

    Properties

    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:

      @@ -69,91 +69,91 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'taskError': Emitted when an error occurs while executing a task.
    • 'backPressure': Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size >= maximum queue size).
    -
    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 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.

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

    Worker choice strategies context referencing worker choice algorithms implementation.

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

    Pool worker nodes.

    -

    Accessors

    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

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

    Pool worker nodes.

    +

    Accessors

    • get busy(): boolean
    • Whether the pool is busy or not.

      Returns boolean

      The pool busyness boolean status.

      -
    • get empty(): boolean
    • Whether the pool is empty or not.

      Returns boolean

      The pool emptiness boolean status.

      -
    • get full(): boolean
    • Whether the pool is full or not.

      Returns boolean

      The pool fullness boolean status.

      -
    • get type(): "fixed" | "dynamic"
    • The pool type.

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

      -

      Returns "fixed" | "dynamic"

    • get worker(): "thread" | "cluster"
    • The worker type.

      -

      Returns "thread" | "cluster"

    Methods

    • Parameters

    • get worker(): "thread" | "cluster"
    • The worker type.

      +

      Returns "thread" | "cluster"

    Methods

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

    Returns void

    • Hook executed before the worker task execution. +

    Returns void

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

      +

    Returns void

    • Terminates the worker node given its worker node key.

      +

    Returns void

    • 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.

      • OptionaltransferList: readonly TransferListItem[]

        An 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.

      -
    • 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.

      • OptionaltransferList: readonly TransferListItem[]

        An 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.

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

      +

    Returns void

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

      +

    Returns void

    • Parameters

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

      Returns void

    • Parameters

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

      Returns void

    \ No newline at end of file +

    Returns void

    diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index 4d5c4a14..e863f041 100644 --- a/docs/classes/FixedThreadPool.html +++ b/docs/classes/FixedThreadPool.html @@ -1,9 +1,9 @@ -FixedThreadPool | poolifier - v4.0.17

    Class FixedThreadPool<Data, Response>

    A thread pool with a fixed number of threads.

    +FixedThreadPool | poolifier - v4.0.18

    Class FixedThreadPool<Data, Response>

    A thread pool with a fixed number of threads.

    Alessandro Pio Ardizio

    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 full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

  • 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

    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. +

    Returns FixedThreadPool<Data, Response>

    Properties

    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:

      @@ -69,92 +69,92 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'taskError': Emitted when an error occurs while executing a task.
    • 'backPressure': Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size >= maximum queue size).
    -
    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 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.

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

    Worker choice strategies context referencing worker choice algorithms implementation.

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

    Pool worker nodes.

    -

    Accessors

    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

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

    Pool worker nodes.

    +

    Accessors

    • get busy(): boolean
    • Whether the pool is busy or not.

      Returns boolean

      The pool busyness boolean status.

      -
    • get empty(): boolean
    • Whether the pool is empty or not.

      Returns boolean

      The pool emptiness boolean status.

      -
    • get full(): boolean
    • Whether the pool is full or not.

      Returns boolean

      The pool fullness boolean status.

      -
    • get type(): "fixed" | "dynamic"
    • The pool type.

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

      -

      Returns "fixed" | "dynamic"

    • get worker(): "thread" | "cluster"
    • The worker type.

      -

      Returns "thread" | "cluster"

    Methods

    • Parameters

    • get worker(): "thread" | "cluster"
    • The worker type.

      +

      Returns "thread" | "cluster"

    Methods

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

    Returns void

    • Hook executed before the worker task execution. +

    Returns void

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

      +

    Returns void

    • Terminates the worker node given its worker node key.

      +

    Returns void

    • 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.

      • OptionaltransferList: readonly TransferListItem[]

        An 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.

      -
    • 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.

      • OptionaltransferList: readonly TransferListItem[]

        An 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.

      -
    • Registers a listener callback on the worker given its 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, unknown>

        The message.

      • OptionaltransferList: readonly TransferListItem[]

        The optional array of transferable objects.

        -

      Returns void

    • Parameters

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

      Returns void

    • Parameters

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

      Returns void

    \ No newline at end of file +

    Returns void

    diff --git a/docs/classes/PriorityQueue.html b/docs/classes/PriorityQueue.html index 911d2a40..343bbfe5 100644 --- a/docs/classes/PriorityQueue.html +++ b/docs/classes/PriorityQueue.html @@ -1,6 +1,6 @@ -PriorityQueue | poolifier - v4.0.17

    Class PriorityQueue<T>Internal

    Priority queue.

    +PriorityQueue | poolifier - v4.0.18

    Class PriorityQueue<T>Internal

    Priority queue.

    Type Parameters

    • T

      Type of priority queue data.

      -

    Constructors

    Constructors

    Properties

    Accessors

    buckets enablePriority @@ -19,20 +19,20 @@
    false
     
    -

    Properties

    maxSize: number

    The priority queue maximum size.

    -

    Accessors

    Properties

    maxSize: number

    The priority queue maximum size.

    +

    Accessors

    • get buckets(): number
    • The number of filled prioritized buckets.

      Returns number

      The number of filled prioritized buckets.

      -

    Methods

    Methods

    • 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.

      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.

      -
    \ No newline at end of file +
    diff --git a/docs/classes/ThreadWorker.html b/docs/classes/ThreadWorker.html index da1637f7..608df5ab 100644 --- a/docs/classes/ThreadWorker.html +++ b/docs/classes/ThreadWorker.html @@ -1,4 +1,4 @@ -ThreadWorker | poolifier - v4.0.17

    Class ThreadWorker<Data, Response>

    A thread worker used by a poolifier ThreadPool.

    +ThreadWorker | poolifier - v4.0.18

    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, @@ -7,7 +7,7 @@ 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 full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

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

    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.

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

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

    -

    Accessors

    Methods

    Returns ThreadWorker<Data, Response>

    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.

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

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

    +

    Accessors

    Methods

    • Handles an error and convert it to a string so it can be sent back to the main worker.

      Parameters

      • error: string | Error

        The error raised by the worker.

      Returns string

      The error message.

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

      +

    Returns void

    Returns void

    Returns void

    • Runs the given task function asynchronously.

      +

    Returns void

    • Runs the given task function synchronously.

      +

    Returns void

    • Sends a message to main worker.

      +

    Returns void

    Returns void

    \ No newline at end of file +
    diff --git a/docs/classes/WorkerChoiceStrategiesContext.html b/docs/classes/WorkerChoiceStrategiesContext.html index 73b72bd1..f8a93476 100644 --- a/docs/classes/WorkerChoiceStrategiesContext.html +++ b/docs/classes/WorkerChoiceStrategiesContext.html @@ -1,8 +1,8 @@ -WorkerChoiceStrategiesContext | poolifier - v4.0.17

    Class WorkerChoiceStrategiesContext<Worker, Data, Response>

    The worker choice strategies context.

    +WorkerChoiceStrategiesContext | poolifier - v4.0.18

    Class WorkerChoiceStrategiesContext<Worker, Data, Response>Internal

    The worker choice strategies context.

    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.

      -

    Constructors

    Constructors

    Properties

    Methods

    execute getPolicy @@ -19,30 +19,30 @@

    Returns WorkerChoiceStrategiesContext<Worker, Data, Response>

    [WorkerChoiceStrategies.ROUND_ROBIN]
     
    -

    Properties

    retriesCount: number

    The number of worker choice strategies execution retries.

    -

    Methods

    Properties

    retriesCount: number

    The number of worker choice strategies execution retries.

    +

    Methods

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

      Parameters

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

        The worker choice strategy algorithm to execute.

      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.

      Parameters

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

        The default worker choice strategy to set.

      • Optionalopts: WorkerChoiceStrategyOptions

        The worker choice strategy options.

        -

      Returns void

    • Sets the active worker choice strategies in the context options.

      +

    Returns void

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

      +

    Returns void

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

      Parameters

      • workerChoiceStrategies: Set<
            | "ROUND_ROBIN"
            | "LEAST_USED"
            | "LEAST_BUSY"
            | "LEAST_ELU"
            | "FAIR_SHARE"
            | "WEIGHTED_ROUND_ROBIN"
            | "INTERLEAVED_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.

      +

    Returns void

    \ No newline at end of file +
    diff --git a/docs/functions/availableParallelism.html b/docs/functions/availableParallelism.html index 599e505d..5995eb87 100644 --- a/docs/functions/availableParallelism.html +++ b/docs/functions/availableParallelism.html @@ -1,4 +1,4 @@ -availableParallelism | poolifier - v4.0.17

    Function availableParallelism

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

    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.

      -
    \ No newline at end of file +
    diff --git a/docs/hierarchy.html b/docs/hierarchy.html index bff3f45e..36d30899 100644 --- a/docs/hierarchy.html +++ b/docs/hierarchy.html @@ -1 +1 @@ -poolifier - v4.0.17
    \ No newline at end of file +poolifier - v4.0.18
    diff --git a/docs/index.html b/docs/index.html index d4c42761..0d75cdf1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,4 +1,4 @@ -poolifier - v4.0.17

    poolifier - v4.0.17

    Index

    Classes

    AbstractPool +poolifier - v4.0.18
    \ No newline at end of file +
    diff --git a/docs/interfaces/EventLoopUtilizationMeasurementStatistics.html b/docs/interfaces/EventLoopUtilizationMeasurementStatistics.html index 161d0040..2cd33119 100644 --- a/docs/interfaces/EventLoopUtilizationMeasurementStatistics.html +++ b/docs/interfaces/EventLoopUtilizationMeasurementStatistics.html @@ -1,5 +1,5 @@ -EventLoopUtilizationMeasurementStatistics | poolifier - v4.0.17

    Interface EventLoopUtilizationMeasurementStatisticsInternal

    Event loop utilization measurement statistics.

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

    Properties

    active +EventLoopUtilizationMeasurementStatistics | poolifier - v4.0.18

    Interface EventLoopUtilizationMeasurementStatisticsInternal

    Event loop utilization measurement statistics.

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

    Properties

    utilization?: number
    \ No newline at end of file +

    Properties

    utilization?: number
    diff --git a/docs/interfaces/FixedQueueNode.html b/docs/interfaces/FixedQueueNode.html index e2ea1603..9caf35a6 100644 --- a/docs/interfaces/FixedQueueNode.html +++ b/docs/interfaces/FixedQueueNode.html @@ -1,5 +1,5 @@ -FixedQueueNode | poolifier - v4.0.17

    Interface FixedQueueNode<T>Internal

    Fixed queue node.

    +FixedQueueNode | poolifier - v4.0.18

    Interface FixedQueueNode<T>Internal

    Fixed queue node.

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

    Type Parameters

    • T

      Type of fixed queue node data.

      -

    Properties

    Properties

    Properties

    data: T
    priority: number
    \ No newline at end of file +

    Properties

    data: T
    priority: number
    diff --git a/docs/interfaces/IFixedQueue.html b/docs/interfaces/IFixedQueue.html index 94d49ff1..93c3cad7 100644 --- a/docs/interfaces/IFixedQueue.html +++ b/docs/interfaces/IFixedQueue.html @@ -1,6 +1,6 @@ -IFixedQueue | poolifier - v4.0.17

    Interface IFixedQueue<T>Internal

    Fixed queue.

    +IFixedQueue | poolifier - v4.0.18

    Interface IFixedQueue<T>Internal

    Fixed queue.

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

    Type Parameters

    • T

      Type of fixed queue data.

      -

    Properties

    Properties

    [iterator] capacity clear dequeue @@ -13,22 +13,22 @@

    Properties

    [iterator]: (() => Iterator<T, any, undefined>)

    Returns an iterator for the fixed queue.

    Type declaration

      • (): Iterator<T, any, undefined>
      • Returns Iterator<T, any, undefined>

        An iterator for the fixed queue.

    capacity: number

    The fixed queue capacity.

    -
    clear: (() => void)

    Clears the fixed queue.

    -
    dequeue: (() => undefined | T)

    Dequeue data from the fixed queue.

    +
    capacity: number

    The fixed queue capacity.

    +
    clear: (() => void)

    Clears the fixed queue.

    +
    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.

    +
    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, priority?): 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.

    +
    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.

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

    Gets data from the fixed queue.

    Type declaration

      • (index): 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: FixedQueueNode<T>[]

    The fixed queue node array.

    -
    size: number

    The fixed queue size.

    -
    \ No newline at end of file +
    nodeArray: FixedQueueNode<T>[]

    The fixed queue node array.

    +
    size: number

    The fixed queue size.

    +
    diff --git a/docs/interfaces/IPool.html b/docs/interfaces/IPool.html index 362038c5..b7a7adee 100644 --- a/docs/interfaces/IPool.html +++ b/docs/interfaces/IPool.html @@ -1,8 +1,8 @@ -IPool | poolifier - v4.0.17

    Interface IPool<Worker, Data, Response>

    Contract definition for a poolifier pool.

    +IPool | poolifier - v4.0.18

    Interface IPool<Worker, Data, Response>

    Contract definition for a poolifier pool.

    interface IPool<Worker, Data, Response> {
        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, transferList?: readonly TransferListItem[]) => Promise<Response>);
        hasTaskFunction: ((name: string) => boolean);
        info: PoolInfo;
        listTaskFunctionsProperties: (() => TaskFunctionProperties[]);
        mapExecute: ((data: Iterable<Data>, name?: string, transferList?: readonly TransferListItem[]) => Promise<Response[]>);
        removeTaskFunction: ((name: string) => Promise<boolean>);
        setDefaultTaskFunction: ((name: string) => Promise<boolean>);
        setTasksQueueOptions: ((tasksQueueOptions: TasksQueueOptions) => void);
        setWorkerChoiceStrategy: ((workerChoiceStrategy:
            | "ROUND_ROBIN"
            | "LEAST_USED"
            | "LEAST_BUSY"
            | "LEAST_ELU"
            | "FAIR_SHARE"
            | "WEIGHTED_ROUND_ROBIN"
            | "INTERLEAVED_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

    Properties

    Implemented by

    Properties

    addTaskFunction destroy emitter? enableTasksQueue @@ -25,8 +25,8 @@ If a task function with the same name already exists, it will be overwritten.

    Returns Promise<boolean>

    true if the task function was added, false otherwise.

    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. +

    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:

      @@ -39,39 +39,39 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'taskError': Emitted when an error occurs while executing a task.
    • 'backPressure': Emitted when all worker nodes have back pressure (i.e. their tasks queue is 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, 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, transferList?: readonly TransferListItem[]) => Promise<Response>)

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

    +

    Returns void

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

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

    Type declaration

      • (data?, name?, transferList?): 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.

        • OptionaltransferList: readonly TransferListItem[]

          An 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.

    +
    hasTaskFunction: ((name: string) => boolean)

    Whether the specified task function exists in this pool.

    Type declaration

      • (name): 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.

    +
    info: PoolInfo

    Pool information.

    +
    listTaskFunctionsProperties: (() => TaskFunctionProperties[])

    Lists the properties of task functions available in this pool.

    Type declaration

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

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

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

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

    Type declaration

      • (data, name?, transferList?): 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.

        • OptionaltransferList: readonly TransferListItem[]

          An 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.

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

    Removes a task function from this pool.

    Type declaration

      • (name): 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.

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

    Sets the default task function in this pool.

    Type declaration

      • (name): 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.

    +
    setTasksQueueOptions: ((tasksQueueOptions: TasksQueueOptions) => void)

    Sets the worker node tasks queue options in this pool.

    Type declaration

      • (tasksQueueOptions): void
      • Parameters

        Returns void

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

    Sets the default worker choice strategy in this pool.

    +

    Returns void

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

    Sets the default worker choice strategy in this pool.

    Type declaration

      • (workerChoiceStrategy, workerChoiceStrategyOptions?): void
      • Parameters

        • workerChoiceStrategy:
              | "ROUND_ROBIN"
              | "LEAST_USED"
              | "LEAST_BUSY"
              | "LEAST_ELU"
              | "FAIR_SHARE"
              | "WEIGHTED_ROUND_ROBIN"
              | "INTERLEAVED_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.

    +

    Returns void

    setWorkerChoiceStrategyOptions: ((workerChoiceStrategyOptions: WorkerChoiceStrategyOptions) => boolean)

    Sets the worker choice strategy options in this pool.

    Type declaration

      • (workerChoiceStrategyOptions): boolean
      • Parameters

        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.

    -
    \ No newline at end of file +
    start: (() => void)

    Starts the minimum number of workers in this pool.

    +
    workerNodes: IWorkerNode<Worker, Data>[]

    Pool worker nodes.

    +
    diff --git a/docs/interfaces/IWorker.html b/docs/interfaces/IWorker.html index 80a3415d..f9829574 100644 --- a/docs/interfaces/IWorker.html +++ b/docs/interfaces/IWorker.html @@ -1,5 +1,5 @@ -IWorker | poolifier - v4.0.17

    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

    Properties

    disconnect? +IWorker | poolifier - v4.0.18

    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

    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

      • (event, handler): this
      • Parameters

        Returns this

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

    Registers once an event handler.

    +

    Returns this

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

    Registers once an event handler.

    Type declaration

      • (event, handler): this
      • Parameters

        Returns this

    terminate?: (() => Promise<number>)

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

    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
      • Rest...args: AnyRest

      Returns void

    Methods

    • Type Parameters

      • K

      Parameters

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

      Returns void

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

      Type Parameters

      • K

      Parameters

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

            • Rest...args: any[]

            Returns 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 to each.

      @@ -132,4 +132,4 @@ memory leaks. The emitter.setMaxListeners() method allows the limit 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

      -
    \ No newline at end of file +
    diff --git a/docs/interfaces/IWorkerChoiceStrategy.html b/docs/interfaces/IWorkerChoiceStrategy.html index 947728fd..675f7e00 100644 --- a/docs/interfaces/IWorkerChoiceStrategy.html +++ b/docs/interfaces/IWorkerChoiceStrategy.html @@ -1,5 +1,5 @@ -IWorkerChoiceStrategy | poolifier - v4.0.17

    Interface IWorkerChoiceStrategyInternal

    Worker choice strategy interface.

    -
    interface IWorkerChoiceStrategy {
        choose: (() => undefined | number);
        remove: ((workerNodeKey: number) => boolean);
        reset: (() => boolean);
        setOptions: ((opts: undefined | WorkerChoiceStrategyOptions) => void);
        strategyPolicy: StrategyPolicy;
        taskStatisticsRequirements: TaskStatisticsRequirements;
        update: ((workerNodeKey: number) => boolean);
    }

    Properties

    choose +IWorkerChoiceStrategy | poolifier - v4.0.18

    Interface IWorkerChoiceStrategyInternal

    Worker choice strategy interface.

    +
    interface IWorkerChoiceStrategy {
        choose: (() => undefined | number);
        remove: ((workerNodeKey: number) => boolean);
        reset: (() => boolean);
        setOptions: ((opts: undefined | WorkerChoiceStrategyOptions) => void);
        strategyPolicy: StrategyPolicy;
        taskStatisticsRequirements: TaskStatisticsRequirements;
        update: ((workerNodeKey: number) => boolean);
    }

    Properties

    choose remove reset setOptions @@ -10,16 +10,16 @@ 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.

        -
    remove: ((workerNodeKey: number) => boolean)

    Removes the worker node key from strategy internals.

    +
    remove: ((workerNodeKey: number) => boolean)

    Removes the worker node key from strategy internals.

    Type declaration

      • (workerNodeKey): 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.

    +
    reset: (() => boolean)

    Resets strategy internals.

    Type declaration

      • (): boolean
      • Returns boolean

        true if the reset is successful, false otherwise.

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

    Sets the worker choice strategy options.

    +
    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. +

    Returns void

    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): boolean
      • Parameters

        • workerNodeKey: number

        Returns boolean

        true if the update is successful, false otherwise.

        -
    \ No newline at end of file +
    diff --git a/docs/interfaces/IWorkerNode.html b/docs/interfaces/IWorkerNode.html index 5ca7f89d..e3480506 100644 --- a/docs/interfaces/IWorkerNode.html +++ b/docs/interfaces/IWorkerNode.html @@ -1,7 +1,7 @@ -IWorkerNode | poolifier - v4.0.17

    Interface IWorkerNode<Worker, Data>Internal

    Worker node interface.

    +IWorkerNode | poolifier - v4.0.18

    Interface IWorkerNode<Worker, Data>Internal

    Worker node interface.

    interface IWorkerNode<Worker, Data> {
        clearTasksQueue: (() => void);
        deleteTaskFunctionWorkerUsage: ((name: string) => boolean);
        dequeueLastPrioritizedTask: (() => undefined | Task<Data>);
        dequeueTask: ((bucket?: number) => undefined | Task<Data>);
        enqueueTask: ((task: Task<Data>) => number);
        getTaskFunctionWorkerUsage: ((name: string) => undefined | WorkerUsage);
        hasBackPressure: (() => boolean);
        info: WorkerInfo;
        messageChannel?: MessageChannel;
        registerOnceWorkerEventHandler: ((event: string, handler: EventHandler<Worker>) => void);
        registerWorkerEventHandler: ((event: string, handler: EventHandler<Worker>) => void);
        setTasksQueuePriority: ((enablePriority: boolean) => void);
        strategyData?: StrategyData;
        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

    Properties

    Hierarchy

    • EventEmitter
      • IWorkerNode

    Properties

    clearTasksQueue: (() => void)

    Clears tasks queue.

    -
    deleteTaskFunctionWorkerUsage: ((name: string) => boolean)

    Deletes task function worker usage statistics.

    +
    deleteTaskFunctionWorkerUsage: ((name: string) => boolean)

    Deletes task function worker usage statistics.

    Type declaration

      • (name): 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.

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

    Dequeue last prioritized task.

    Type declaration

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

    Dequeue task.

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

    Dequeue task.

    Type declaration

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

        • Optionalbucket: number

          The prioritized bucket to dequeue from.

        Returns undefined | Task<Data>

        The dequeued task.

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

    Enqueue task.

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

    Enqueue task.

    Type declaration

      • (task): number
      • Parameters

        Returns number

        The tasks queue size.

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

    Gets task function worker usage statistics.

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

    Gets task function worker usage statistics.

    Type declaration

      • (name): 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.

        -
    hasBackPressure: (() => boolean)

    Whether the worker node has back pressure (i.e. its tasks queue is full).

    +
    hasBackPressure: (() => boolean)

    Whether the worker node has back pressure (i.e. its tasks queue is full).

    Type declaration

      • (): boolean
      • Returns boolean

        true if the worker node has back pressure, false otherwise.

        -

    Worker info.

    -
    messageChannel?: MessageChannel

    Message channel (worker thread only).

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

    Registers once a worker event handler.

    +

    Worker info.

    +
    messageChannel?: MessageChannel

    Message channel (worker thread only).

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

    Registers once a worker event handler.

    Type declaration

      • (event, handler): void
      • Parameters

        Returns void

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

    Registers a worker event handler.

    +

    Returns void

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

    Registers a worker event handler.

    Type declaration

      • (event, handler): void
      • Parameters

        Returns void

    setTasksQueuePriority: ((enablePriority: boolean) => void)

    Sets tasks queue priority.

    +

    Returns void

    setTasksQueuePriority: ((enablePriority: boolean) => void)

    Sets tasks queue priority.

    Type declaration

      • (enablePriority): 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.

    -
    tasksQueueBackPressureSize: number

    Tasks queue back pressure size. +

    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
      • Rest...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
      • Rest...args: AnyRest

      Returns void

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

      Type Parameters

      • K

      Parameters

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

            • Rest...args: any[]

            Returns 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 to each.

      @@ -200,4 +200,4 @@ memory leaks. The emitter.setMaxListeners() method allows the limit 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

      -
    \ No newline at end of file +
    diff --git a/docs/interfaces/MeasurementOptions.html b/docs/interfaces/MeasurementOptions.html index 68441973..b231ac06 100644 --- a/docs/interfaces/MeasurementOptions.html +++ b/docs/interfaces/MeasurementOptions.html @@ -1,4 +1,4 @@ -MeasurementOptions | poolifier - v4.0.17

    Interface MeasurementOptions

    Measurement options.

    -
    interface MeasurementOptions {
        median: boolean;
    }

    Properties

    median +MeasurementOptions | poolifier - v4.0.18

    Interface MeasurementOptions

    Measurement options.

    +
    interface MeasurementOptions {
        median: boolean;
    }

    Properties

    Properties

    median: boolean

    Set measurement median.

    -
    \ No newline at end of file +
    diff --git a/docs/interfaces/MeasurementStatistics.html b/docs/interfaces/MeasurementStatistics.html index b4324317..4e580e74 100644 --- a/docs/interfaces/MeasurementStatistics.html +++ b/docs/interfaces/MeasurementStatistics.html @@ -1,14 +1,14 @@ -MeasurementStatistics | poolifier - v4.0.17

    Interface MeasurementStatisticsInternal

    Measurement statistics.

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

    Properties

    aggregate? +MeasurementStatistics | poolifier - v4.0.18

    Interface MeasurementStatisticsInternal

    Measurement statistics.

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

    Properties

    aggregate?: number

    Measurement aggregate.

    -
    average?: number

    Measurement average.

    -

    Measurement history.

    -
    maximum?: number

    Measurement maximum.

    -
    median?: number

    Measurement median.

    -
    minimum?: number

    Measurement minimum.

    -
    \ No newline at end of file +
    average?: number

    Measurement average.

    +

    Measurement history.

    +
    maximum?: number

    Measurement maximum.

    +
    median?: number

    Measurement median.

    +
    minimum?: number

    Measurement minimum.

    +
    diff --git a/docs/interfaces/MeasurementStatisticsRequirements.html b/docs/interfaces/MeasurementStatisticsRequirements.html index 30f52537..7e94fd00 100644 --- a/docs/interfaces/MeasurementStatisticsRequirements.html +++ b/docs/interfaces/MeasurementStatisticsRequirements.html @@ -1,8 +1,8 @@ -MeasurementStatisticsRequirements | poolifier - v4.0.17

    Interface MeasurementStatisticsRequirementsInternal

    Measurement statistics requirements.

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

    Properties

    aggregate +MeasurementStatisticsRequirements | poolifier - v4.0.18

    Interface MeasurementStatisticsRequirementsInternal

    Measurement statistics requirements.

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

    Properties

    aggregate: boolean

    Requires measurement aggregate.

    -
    average: boolean

    Requires measurement average.

    -
    median: boolean

    Requires measurement median.

    -
    \ No newline at end of file +
    average: boolean

    Requires measurement average.

    +
    median: boolean

    Requires measurement median.

    +
    diff --git a/docs/interfaces/MessageValue.html b/docs/interfaces/MessageValue.html index 3d8c0515..3b3aeb8b 100644 --- a/docs/interfaces/MessageValue.html +++ b/docs/interfaces/MessageValue.html @@ -1,7 +1,7 @@ -MessageValue | poolifier - v4.0.17

    Interface MessageValue<Data, ErrorData>Internal

    Message object that is passed between main worker and worker.

    +MessageValue | poolifier - v4.0.18

    Interface MessageValue<Data, ErrorData>Internal

    Message object that is passed between main worker and worker.

    interface MessageValue<Data, ErrorData> {
        checkActive?: boolean;
        data?: Data;
        kill?:
            | true
            | "success"
            | "SOFT"
            | "HARD"
            | "failure";
        name?: string;
        port?: MessagePort;
        priority?: number;
        ready?: boolean;
        statistics?: WorkerStatistics;
        strategy?:
            | "ROUND_ROBIN"
            | "LEAST_USED"
            | "LEAST_BUSY"
            | "LEAST_ELU"
            | "FAIR_SHARE"
            | "WEIGHTED_ROUND_ROBIN"
            | "INTERLEAVED_WEIGHTED_ROUND_ROBIN";
        taskFunction?: string;
        taskFunctionOperation?: "add" | "default" | "remove";
        taskFunctionOperationStatus?: boolean;
        taskFunctionProperties?: TaskFunctionProperties;
        taskFunctionsProperties?: TaskFunctionProperties[];
        taskId?: `${string}-${string}-${string}-${string}-${string}`;
        taskPerformance?: TaskPerformance;
        timestamp?: number;
        transferList?: readonly TransferListItem[];
        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 full)

    Properties

    Hierarchy (view full)

    Properties

    Properties

    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"
        | "SOFT"
        | "HARD"
        | "failure"

    Kill code.

    -
    name?: string

    Task name.

    -
    port?: MessagePort

    Message port.

    -
    priority?: number

    Task priority. Lower values have higher priority.

    +
    data?: Data

    Task input data that will be passed to the worker.

    +
    kill?:
        | true
        | "success"
        | "SOFT"
        | "HARD"
        | "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?:
        | "ROUND_ROBIN"
        | "LEAST_USED"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "FAIR_SHARE"
        | "WEIGHTED_ROUND_ROBIN"
        | "INTERLEAVED_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?:
        | "ROUND_ROBIN"
        | "LEAST_USED"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "FAIR_SHARE"
        | "WEIGHTED_ROUND_ROBIN"
        | "INTERLEAVED_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.

    -
    taskPerformance?: TaskPerformance

    Task performance.

    -
    timestamp?: number

    Timestamp.

    -
    transferList?: readonly TransferListItem[]

    Array of transferable objects.

    -
    workerError?: WorkerError<ErrorData>

    Worker error.

    -
    workerId?: number

    Worker id.

    -
    \ No newline at end of file +
    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.

    +
    taskPerformance?: TaskPerformance

    Task performance.

    +
    timestamp?: number

    Timestamp.

    +
    transferList?: readonly TransferListItem[]

    Array of transferable objects.

    +
    workerError?: WorkerError<ErrorData>

    Worker error.

    +
    workerId?: number

    Worker id.

    +
    diff --git a/docs/interfaces/PoolInfo.html b/docs/interfaces/PoolInfo.html index febf1a60..a5992068 100644 --- a/docs/interfaces/PoolInfo.html +++ b/docs/interfaces/PoolInfo.html @@ -1,5 +1,5 @@ -PoolInfo | poolifier - v4.0.17

    Interface PoolInfo

    Pool information.

    -
    interface PoolInfo {
        backPressure?: boolean;
        busyWorkerNodes: number;
        defaultStrategy:
            | "ROUND_ROBIN"
            | "LEAST_USED"
            | "LEAST_BUSY"
            | "LEAST_ELU"
            | "FAIR_SHARE"
            | "WEIGHTED_ROUND_ROBIN"
            | "INTERLEAVED_WEIGHTED_ROUND_ROBIN";
        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: "thread" | "cluster";
        workerNodes: number;
    }

    Properties

    backPressure? +PoolInfo | poolifier - v4.0.18

    Interface PoolInfo

    Pool information.

    +
    interface PoolInfo {
        backPressure?: boolean;
        busyWorkerNodes: number;
        defaultStrategy:
            | "ROUND_ROBIN"
            | "LEAST_USED"
            | "LEAST_BUSY"
            | "LEAST_ELU"
            | "FAIR_SHARE"
            | "WEIGHTED_ROUND_ROBIN"
            | "INTERLEAVED_WEIGHTED_ROUND_ROBIN";
        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: "thread" | "cluster";
        workerNodes: number;
    }

    Properties

    backPressure?: boolean
    busyWorkerNodes: number

    Pool busy worker nodes.

    -
    defaultStrategy:
        | "ROUND_ROBIN"
        | "LEAST_USED"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "FAIR_SHARE"
        | "WEIGHTED_ROUND_ROBIN"
        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
    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 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: "thread" | "cluster"
    workerNodes: number

    Pool total worker nodes.

    -
    \ No newline at end of file +

    Properties

    backPressure?: boolean
    busyWorkerNodes: number

    Pool busy worker nodes.

    +
    defaultStrategy:
        | "ROUND_ROBIN"
        | "LEAST_USED"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "FAIR_SHARE"
        | "WEIGHTED_ROUND_ROBIN"
        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
    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 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: "thread" | "cluster"
    workerNodes: number

    Pool total worker nodes.

    +
    diff --git a/docs/interfaces/PoolOptions.html b/docs/interfaces/PoolOptions.html index e82d2c0f..6db37ae0 100644 --- a/docs/interfaces/PoolOptions.html +++ b/docs/interfaces/PoolOptions.html @@ -1,6 +1,6 @@ -PoolOptions | poolifier - v4.0.17

    Interface PoolOptions<Worker>

    Options for a poolifier pool.

    +PoolOptions | poolifier - v4.0.18

    Interface PoolOptions<Worker>

    Options for a poolifier pool.

    interface PoolOptions<Worker> {
        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?:
            | "ROUND_ROBIN"
            | "LEAST_USED"
            | "LEAST_BUSY"
            | "LEAST_ELU"
            | "FAIR_SHARE"
            | "WEIGHTED_ROUND_ROBIN"
            | "INTERLEAVED_WEIGHTED_ROUND_ROBIN";
        workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions;
        workerOptions?: WorkerOptions;
    }

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -

    Properties

    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?:
        | "ROUND_ROBIN"
        | "LEAST_USED"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "FAIR_SHARE"
        | "WEIGHTED_ROUND_ROBIN"
        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

    The default worker choice strategy to use in this pool.

    +
    tasksQueueOptions?: TasksQueueOptions

    Pool worker node tasks queue options.

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

    The default worker choice strategy to use in this pool.

    WorkerChoiceStrategies.ROUND_ROBIN
     
    -
    workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions

    The worker choice strategy options.

    -
    workerOptions?: WorkerOptions

    Worker options.

    +
    workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions

    The worker choice strategy options.

    +
    workerOptions?: WorkerOptions

    Worker options.

    \ No newline at end of file +
    diff --git a/docs/interfaces/PromiseResponseWrapper.html b/docs/interfaces/PromiseResponseWrapper.html index d992ef54..26011f8e 100644 --- a/docs/interfaces/PromiseResponseWrapper.html +++ b/docs/interfaces/PromiseResponseWrapper.html @@ -1,11 +1,11 @@ -PromiseResponseWrapper | poolifier - v4.0.17

    Interface PromiseResponseWrapper<Response>Internal

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

    +PromiseResponseWrapper | poolifier - v4.0.18

    Interface PromiseResponseWrapper<Response>Internal

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

    interface PromiseResponseWrapper<Response> {
        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.

      -

    Properties

    Properties

    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.

    -
    \ No newline at end of file +
    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/StrategyData.html b/docs/interfaces/StrategyData.html index 06dd3777..f808cd21 100644 --- a/docs/interfaces/StrategyData.html +++ b/docs/interfaces/StrategyData.html @@ -1,3 +1,3 @@ -StrategyData | poolifier - v4.0.17

    Interface StrategyDataInternal

    Worker choice strategy data.

    -
    interface StrategyData {
        virtualTaskEndTimestamp?: number;
    }

    Properties

    virtualTaskEndTimestamp?: number
    \ No newline at end of file +StrategyData | poolifier - v4.0.18

    Interface StrategyDataInternal

    Worker choice strategy data.

    +
    interface StrategyData {
        virtualTaskEndTimestamp?: number;
    }

    Properties

    virtualTaskEndTimestamp?: number
    diff --git a/docs/interfaces/StrategyPolicy.html b/docs/interfaces/StrategyPolicy.html index d5a29ebd..1cc68851 100644 --- a/docs/interfaces/StrategyPolicy.html +++ b/docs/interfaces/StrategyPolicy.html @@ -1,6 +1,6 @@ -StrategyPolicy | poolifier - v4.0.17

    Interface StrategyPolicyInternal

    Strategy policy.

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

    Properties

    dynamicWorkerReady +StrategyPolicy | poolifier - v4.0.18

    Interface StrategyPolicyInternal

    Strategy policy.

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

    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.

    -
    \ No newline at end of file +
    dynamicWorkerUsage: boolean

    Expects tasks execution on the newly created dynamic worker.

    +
    diff --git a/docs/interfaces/Task.html b/docs/interfaces/Task.html index a9018c61..bfddc55b 100644 --- a/docs/interfaces/Task.html +++ b/docs/interfaces/Task.html @@ -1,6 +1,6 @@ -Task | poolifier - v4.0.17

    Interface Task<Data>Internal

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

    +Task | poolifier - v4.0.18

    Interface Task<Data>Internal

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

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

    Type Parameters

    • Data = unknown

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

      -

    Hierarchy (view full)

    Properties

    Hierarchy (view full)

    Properties

    Properties

    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.

    +
    name?: string

    Task name.

    +
    priority?: number

    Task priority. Lower values have higher priority.

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

    Task worker choice strategy.

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

    Task UUID.

    -
    timestamp?: number

    Timestamp.

    -
    transferList?: readonly TransferListItem[]

    Array of transferable objects.

    -
    \ No newline at end of file +
    strategy?:
        | "ROUND_ROBIN"
        | "LEAST_USED"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "FAIR_SHARE"
        | "WEIGHTED_ROUND_ROBIN"
        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

    Task worker choice strategy.

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

    Task UUID.

    +
    timestamp?: number

    Timestamp.

    +
    transferList?: readonly TransferListItem[]

    Array of transferable objects.

    +
    diff --git a/docs/interfaces/TaskFunctionObject.html b/docs/interfaces/TaskFunctionObject.html index e0e49588..b62ccfaf 100644 --- a/docs/interfaces/TaskFunctionObject.html +++ b/docs/interfaces/TaskFunctionObject.html @@ -1,10 +1,10 @@ -TaskFunctionObject | poolifier - v4.0.17

    Interface TaskFunctionObject<Data, Response>

    Task function object.

    +TaskFunctionObject | poolifier - v4.0.18

    Interface TaskFunctionObject<Data, Response>

    Task function object.

    interface TaskFunctionObject<Data, Response> {
        priority?: number;
        strategy?:
            | "ROUND_ROBIN"
            | "LEAST_USED"
            | "LEAST_BUSY"
            | "LEAST_ELU"
            | "FAIR_SHARE"
            | "WEIGHTED_ROUND_ROBIN"
            | "INTERLEAVED_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.

      -

    Properties

    Properties

    priority?: number

    Task function priority. Lower values have higher priority.

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

    Task function worker choice strategy.

    -
    taskFunction: TaskFunction<Data, Response>

    Task function.

    -
    \ No newline at end of file +
    strategy?:
        | "ROUND_ROBIN"
        | "LEAST_USED"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "FAIR_SHARE"
        | "WEIGHTED_ROUND_ROBIN"
        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

    Task function worker choice strategy.

    +
    taskFunction: TaskFunction<Data, Response>

    Task function.

    +
    diff --git a/docs/interfaces/TaskFunctionOperationResult.html b/docs/interfaces/TaskFunctionOperationResult.html index 1c09d800..4c0a5728 100644 --- a/docs/interfaces/TaskFunctionOperationResult.html +++ b/docs/interfaces/TaskFunctionOperationResult.html @@ -1,4 +1,4 @@ -TaskFunctionOperationResult | poolifier - v4.0.17

    Interface TaskFunctionOperationResult

    Task function operation result.

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

    Properties

    error? +TaskFunctionOperationResult | poolifier - v4.0.18

    Interface TaskFunctionOperationResult

    Task function operation result.

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

    Properties

    Properties

    error?: Error
    status: boolean
    \ No newline at end of file +

    Properties

    error?: Error
    status: boolean
    diff --git a/docs/interfaces/TaskFunctionProperties.html b/docs/interfaces/TaskFunctionProperties.html index c7eb05ac..2563a139 100644 --- a/docs/interfaces/TaskFunctionProperties.html +++ b/docs/interfaces/TaskFunctionProperties.html @@ -1,8 +1,8 @@ -TaskFunctionProperties | poolifier - v4.0.17

    Interface TaskFunctionProperties

    Task function properties.

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

    Properties

    name +TaskFunctionProperties | poolifier - v4.0.18

    Interface TaskFunctionProperties

    Task function properties.

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

    Properties

    name: string

    Task function name.

    -
    priority?: number

    Task function priority. Lower values have higher priority.

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

    Task function worker choice strategy.

    -
    \ No newline at end of file +
    priority?: number

    Task function priority. Lower values have higher priority.

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

    Task function worker choice strategy.

    +
    diff --git a/docs/interfaces/TaskPerformance.html b/docs/interfaces/TaskPerformance.html index 46b6bef5..96fb2997 100644 --- a/docs/interfaces/TaskPerformance.html +++ b/docs/interfaces/TaskPerformance.html @@ -1,10 +1,10 @@ -TaskPerformance | poolifier - v4.0.17

    Interface TaskPerformanceInternal

    Task performance.

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

    Properties

    elu? +TaskPerformance | poolifier - v4.0.18

    Interface TaskPerformanceInternal

    Task performance.

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

    Properties

    elu?: EventLoopUtilization

    Task event loop utilization.

    -
    name: string

    Task name.

    -
    runTime?: number

    Task runtime.

    -
    timestamp: number

    Task performance timestamp.

    -
    \ No newline at end of file +
    name: string

    Task name.

    +
    runTime?: number

    Task runtime.

    +
    timestamp: number

    Task performance timestamp.

    +
    diff --git a/docs/interfaces/TaskStatistics.html b/docs/interfaces/TaskStatistics.html index c81429ce..e90c316a 100644 --- a/docs/interfaces/TaskStatistics.html +++ b/docs/interfaces/TaskStatistics.html @@ -1,5 +1,5 @@ -TaskStatistics | poolifier - v4.0.17

    Interface TaskStatisticsInternal

    Task statistics.

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

    Properties

    executed +TaskStatistics | poolifier - v4.0.18

    Interface TaskStatisticsInternal

    Task statistics.

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

    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.

    -
    \ No newline at end of file +
    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/TaskStatisticsRequirements.html b/docs/interfaces/TaskStatisticsRequirements.html index f29bf559..fa5b69c3 100644 --- a/docs/interfaces/TaskStatisticsRequirements.html +++ b/docs/interfaces/TaskStatisticsRequirements.html @@ -1,8 +1,8 @@ -TaskStatisticsRequirements | poolifier - v4.0.17

    Interface TaskStatisticsRequirementsInternal

    Pool worker node worker usage statistics requirements.

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

    Properties

    elu +TaskStatisticsRequirements | poolifier - v4.0.18

    Interface TaskStatisticsRequirementsInternal

    Pool worker node worker usage statistics requirements.

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

    Properties

    Properties

    Tasks event loop utilization requirements.

    -

    Tasks runtime requirements.

    -

    Tasks wait time requirements.

    -
    \ No newline at end of file +

    Tasks runtime requirements.

    +

    Tasks wait time requirements.

    +
    diff --git a/docs/interfaces/TasksQueueOptions.html b/docs/interfaces/TasksQueueOptions.html index 2d0f5491..49e48ab1 100644 --- a/docs/interfaces/TasksQueueOptions.html +++ b/docs/interfaces/TasksQueueOptions.html @@ -1,5 +1,5 @@ -TasksQueueOptions | poolifier - v4.0.17

    Interface TasksQueueOptions

    Worker node tasks queue options.

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

    Properties

    concurrency? +TasksQueueOptions | poolifier - v4.0.18

    Interface TasksQueueOptions

    Worker node tasks queue options.

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

    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
     
    -
    taskStealing?: boolean

    Whether to enable task stealing on idle.

    +
    taskStealing?: boolean

    Whether to enable task stealing on idle.

    true
     
    -
    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.

    false
     
    -
    \ No newline at end of file +
    diff --git a/docs/interfaces/WorkerChoiceStrategyOptions.html b/docs/interfaces/WorkerChoiceStrategyOptions.html index 13acee53..04a80eba 100644 --- a/docs/interfaces/WorkerChoiceStrategyOptions.html +++ b/docs/interfaces/WorkerChoiceStrategyOptions.html @@ -1,5 +1,5 @@ -WorkerChoiceStrategyOptions | poolifier - v4.0.17

    Interface WorkerChoiceStrategyOptions

    Worker choice strategy options.

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

    Properties

    elu? +WorkerChoiceStrategyOptions | poolifier - v4.0.18

    Interface WorkerChoiceStrategyOptions

    Worker choice strategy options.

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

    Properties

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

    Measurement to use in worker choice strategy supporting it.

    -

    Runtime options.

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

    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.
     
    -
    \ No newline at end of file +
    diff --git a/docs/interfaces/WorkerError.html b/docs/interfaces/WorkerError.html index 6e31e067..9a0de651 100644 --- a/docs/interfaces/WorkerError.html +++ b/docs/interfaces/WorkerError.html @@ -1,9 +1,9 @@ -WorkerError | poolifier - v4.0.17

    Interface WorkerError<Data>

    Worker error.

    +WorkerError | poolifier - v4.0.18

    Interface WorkerError<Data>

    Worker error.

    interface WorkerError<Data> {
        data?: Data;
        message: string;
        name: string;
    }

    Type Parameters

    • Data = unknown

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

      -

    Properties

    Properties

    Properties

    data?: Data

    Data triggering the error.

    -
    message: string

    Error message.

    -
    name: string

    Task function name triggering the error.

    -
    \ No newline at end of file +
    message: string

    Error message.

    +
    name: string

    Task function name triggering the error.

    +
    diff --git a/docs/interfaces/WorkerInfo.html b/docs/interfaces/WorkerInfo.html index 1daf2a69..43c8d898 100644 --- a/docs/interfaces/WorkerInfo.html +++ b/docs/interfaces/WorkerInfo.html @@ -1,5 +1,5 @@ -WorkerInfo | poolifier - v4.0.17

    Interface WorkerInfoInternal

    Worker information.

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

    Properties

    backPressure +WorkerInfo | poolifier - v4.0.18

    Interface WorkerInfoInternal

    Worker information.

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

    Properties

    backPressure dynamic id ready @@ -8,11 +8,11 @@ type

    Properties

    backPressure: boolean

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

    -
    dynamic: boolean

    Dynamic flag.

    -
    id: undefined | number

    Worker id.

    -
    ready: boolean

    Ready flag.

    -
    stealing: boolean

    Stealing flag. +

    dynamic: boolean

    Dynamic flag.

    +
    id: undefined | number

    Worker id.

    +
    ready: boolean

    Ready flag.

    +
    stealing: boolean

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

    -
    taskFunctionsProperties?: TaskFunctionProperties[]

    Task functions properties.

    -
    type: "thread" | "cluster"

    Worker type.

    -
    \ No newline at end of file +
    taskFunctionsProperties?: TaskFunctionProperties[]

    Task functions properties.

    +
    type: "thread" | "cluster"

    Worker type.

    +
    diff --git a/docs/interfaces/WorkerNodeEventDetail.html b/docs/interfaces/WorkerNodeEventDetail.html index bd30a3c8..993a4cb2 100644 --- a/docs/interfaces/WorkerNodeEventDetail.html +++ b/docs/interfaces/WorkerNodeEventDetail.html @@ -1,4 +1,4 @@ -WorkerNodeEventDetail | poolifier - v4.0.17

    Interface WorkerNodeEventDetailInternal

    Worker node event detail.

    -
    interface WorkerNodeEventDetail {
        workerId?: number;
        workerNodeKey?: number;
    }

    Properties

    workerId? +WorkerNodeEventDetail | poolifier - v4.0.18

    Interface WorkerNodeEventDetailInternal

    Worker node event detail.

    +
    interface WorkerNodeEventDetail {
        workerId?: number;
        workerNodeKey?: number;
    }

    Properties

    workerId?: number
    workerNodeKey?: number
    \ No newline at end of file +

    Properties

    workerId?: number
    workerNodeKey?: number
    diff --git a/docs/interfaces/WorkerNodeOptions.html b/docs/interfaces/WorkerNodeOptions.html index d70ce130..afb9c89a 100644 --- a/docs/interfaces/WorkerNodeOptions.html +++ b/docs/interfaces/WorkerNodeOptions.html @@ -1,7 +1,7 @@ -WorkerNodeOptions | poolifier - v4.0.17

    Interface WorkerNodeOptionsInternal

    Worker node options.

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

    Properties

    env? +WorkerNodeOptions | poolifier - v4.0.18

    Interface WorkerNodeOptionsInternal

    Worker node options.

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

    Properties

    env?: Record<string, unknown>
    tasksQueueBackPressureSize: undefined | number
    tasksQueueBucketSize: undefined | number
    tasksQueuePriority: undefined | boolean
    workerOptions?: WorkerOptions
    \ No newline at end of file +

    Properties

    env?: Record<string, unknown>
    tasksQueueBackPressureSize: undefined | number
    tasksQueueBucketSize: undefined | number
    tasksQueuePriority: undefined | boolean
    workerOptions?: WorkerOptions
    diff --git a/docs/interfaces/WorkerOptions.html b/docs/interfaces/WorkerOptions.html index 86a0fde6..0f1b63b5 100644 --- a/docs/interfaces/WorkerOptions.html +++ b/docs/interfaces/WorkerOptions.html @@ -1,5 +1,5 @@ -WorkerOptions | poolifier - v4.0.17

    Interface WorkerOptions

    Options for workers.

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

    Properties

    killBehavior? +WorkerOptions | poolifier - v4.0.18

    Interface WorkerOptions

    Options for workers.

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

    Properties

    killBehavior?: "SOFT" | "HARD"

    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
     
    -
    \ No newline at end of file +
    diff --git a/docs/interfaces/WorkerStatistics.html b/docs/interfaces/WorkerStatistics.html index 3ffaa14a..e1cf610d 100644 --- a/docs/interfaces/WorkerStatistics.html +++ b/docs/interfaces/WorkerStatistics.html @@ -1,6 +1,6 @@ -WorkerStatistics | poolifier - v4.0.17

    Interface WorkerStatisticsInternal

    Worker task performance statistics computation settings.

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

    Properties

    elu +WorkerStatistics | poolifier - v4.0.18

    Interface WorkerStatisticsInternal

    Worker task performance statistics computation settings.

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

    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.

    -
    \ No newline at end of file +
    runTime: boolean

    Whether the worker computes the task runtime or not.

    +
    diff --git a/docs/interfaces/WorkerUsage.html b/docs/interfaces/WorkerUsage.html index 84567f35..f3712cc0 100644 --- a/docs/interfaces/WorkerUsage.html +++ b/docs/interfaces/WorkerUsage.html @@ -1,10 +1,10 @@ -WorkerUsage | poolifier - v4.0.17

    Interface WorkerUsageInternal

    Worker usage statistics.

    -
    interface WorkerUsage {
        elu: EventLoopUtilizationMeasurementStatistics;
        runTime: MeasurementStatistics;
        tasks: TaskStatistics;
        waitTime: MeasurementStatistics;
    }

    Properties

    elu +WorkerUsage | poolifier - v4.0.18

    Interface WorkerUsageInternal

    Worker usage statistics.

    +
    interface WorkerUsage {
        elu: EventLoopUtilizationMeasurementStatistics;
        runTime: MeasurementStatistics;
        tasks: TaskStatistics;
        waitTime: MeasurementStatistics;
    }

    Properties

    Tasks event loop utilization statistics.

    -

    Tasks runtime statistics.

    -

    Tasks statistics.

    -

    Tasks wait time statistics.

    -
    \ No newline at end of file +

    Tasks runtime statistics.

    +

    Tasks statistics.

    +

    Tasks wait time statistics.

    +
    diff --git a/docs/types/ClusterPoolOptions.html b/docs/types/ClusterPoolOptions.html index e1121d4d..93abc22c 100644 --- a/docs/types/ClusterPoolOptions.html +++ b/docs/types/ClusterPoolOptions.html @@ -1,2 +1,2 @@ -ClusterPoolOptions | poolifier - v4.0.17

    Type Alias ClusterPoolOptions

    ClusterPoolOptions: PoolOptions<Worker>

    Options for a poolifier cluster pool.

    -
    \ No newline at end of file +ClusterPoolOptions | poolifier - v4.0.18

    Type Alias ClusterPoolOptions

    ClusterPoolOptions: PoolOptions<Worker>

    Options for a poolifier cluster pool.

    +
    diff --git a/docs/types/ErrorHandler.html b/docs/types/ErrorHandler.html index 84b59450..916e1bf6 100644 --- a/docs/types/ErrorHandler.html +++ b/docs/types/ErrorHandler.html @@ -1,3 +1,3 @@ -ErrorHandler | poolifier - v4.0.17

    Type Alias ErrorHandler<Worker>

    ErrorHandler<Worker>: ((this: Worker, error: Error) => void)

    Callback invoked if the worker raised an error.

    +ErrorHandler | poolifier - v4.0.18

    Type Alias ErrorHandler<Worker>

    ErrorHandler<Worker>: ((this: Worker, error: Error) => void)

    Callback invoked if the worker raised an error.

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -
    \ No newline at end of file +
    diff --git a/docs/types/EventHandler.html b/docs/types/EventHandler.html index 26f07c96..23365584 100644 --- a/docs/types/EventHandler.html +++ b/docs/types/EventHandler.html @@ -1,3 +1,3 @@ -EventHandler | poolifier - v4.0.17

    Type Alias EventHandler<Worker>

    EventHandler<Worker>:
        | OnlineHandler<Worker>
        | MessageHandler<Worker>
        | ErrorHandler<Worker>
        | ExitHandler<Worker>

    Worker event handler.

    +EventHandler | poolifier - v4.0.18

    Type Alias EventHandler<Worker>

    EventHandler<Worker>:
        | OnlineHandler<Worker>
        | MessageHandler<Worker>
        | ErrorHandler<Worker>
        | ExitHandler<Worker>

    Worker event handler.

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -
    \ No newline at end of file +
    diff --git a/docs/types/ExitHandler.html b/docs/types/ExitHandler.html index d9bb50dc..2ceab333 100644 --- a/docs/types/ExitHandler.html +++ b/docs/types/ExitHandler.html @@ -1,3 +1,3 @@ -ExitHandler | poolifier - v4.0.17

    Type Alias ExitHandler<Worker>

    ExitHandler<Worker>: ((this: Worker, exitCode: number) => void)

    Callback invoked when the worker exits successfully.

    +ExitHandler | poolifier - v4.0.18

    Type Alias ExitHandler<Worker>

    ExitHandler<Worker>: ((this: Worker, exitCode: number) => void)

    Callback invoked when the worker exits successfully.

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -
    \ No newline at end of file +
    diff --git a/docs/types/KillBehavior.html b/docs/types/KillBehavior.html index 7a402980..e622c319 100644 --- a/docs/types/KillBehavior.html +++ b/docs/types/KillBehavior.html @@ -1,2 +1,2 @@ -KillBehavior | poolifier - v4.0.17

    Type Alias KillBehavior

    KillBehavior: keyof typeof KillBehaviors

    Kill behavior.

    -
    \ No newline at end of file +KillBehavior | poolifier - v4.0.18

    Type Alias KillBehavior

    KillBehavior: keyof typeof KillBehaviors

    Kill behavior.

    +
    diff --git a/docs/types/KillHandler.html b/docs/types/KillHandler.html index 9ae9acf3..88002a0c 100644 --- a/docs/types/KillHandler.html +++ b/docs/types/KillHandler.html @@ -1,2 +1,2 @@ -KillHandler | poolifier - v4.0.17

    Type Alias KillHandler

    KillHandler: (() => void | Promise<void>)

    Handler called when a worker is killed.

    -
    \ No newline at end of file +KillHandler | poolifier - v4.0.18

    Type Alias KillHandler

    KillHandler: (() => void | Promise<void>)

    Handler called when a worker is killed.

    +
    diff --git a/docs/types/Measurement.html b/docs/types/Measurement.html index 89252f6b..cce07c45 100644 --- a/docs/types/Measurement.html +++ b/docs/types/Measurement.html @@ -1,2 +1,2 @@ -Measurement | poolifier - v4.0.17

    Type Alias Measurement

    Measurement: keyof typeof Measurements

    Measurement.

    -
    \ No newline at end of file +Measurement | poolifier - v4.0.18

    Type Alias Measurement

    Measurement: keyof typeof Measurements

    Measurement.

    +
    diff --git a/docs/types/MessageHandler.html b/docs/types/MessageHandler.html index 5c3ac28d..c3d1d3fa 100644 --- a/docs/types/MessageHandler.html +++ b/docs/types/MessageHandler.html @@ -1,3 +1,3 @@ -MessageHandler | poolifier - v4.0.17

    Type Alias MessageHandler<Worker>

    MessageHandler<Worker>: ((this: Worker, message: unknown) => void)

    Callback invoked if the worker has received a message.

    +MessageHandler | poolifier - v4.0.18

    Type Alias MessageHandler<Worker>

    MessageHandler<Worker>: ((this: Worker, message: unknown) => void)

    Callback invoked if the worker has received a message.

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -
    \ No newline at end of file +
    diff --git a/docs/types/OnlineHandler.html b/docs/types/OnlineHandler.html index 6be6f2b5..3030627c 100644 --- a/docs/types/OnlineHandler.html +++ b/docs/types/OnlineHandler.html @@ -1,3 +1,3 @@ -OnlineHandler | poolifier - v4.0.17

    Type Alias OnlineHandler<Worker>

    OnlineHandler<Worker>: ((this: Worker) => void)

    Callback invoked when the worker has started successfully.

    +OnlineHandler | poolifier - v4.0.18

    Type Alias OnlineHandler<Worker>

    OnlineHandler<Worker>: ((this: Worker) => void)

    Callback invoked when the worker has started successfully.

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -
    \ No newline at end of file +
    diff --git a/docs/types/PoolEvent.html b/docs/types/PoolEvent.html index 5dd145e4..60f25af3 100644 --- a/docs/types/PoolEvent.html +++ b/docs/types/PoolEvent.html @@ -1,2 +1,2 @@ -PoolEvent | poolifier - v4.0.17

    Type Alias PoolEvent

    PoolEvent: keyof typeof PoolEvents

    Pool event.

    -
    \ No newline at end of file +PoolEvent | poolifier - v4.0.18

    Type Alias PoolEvent

    PoolEvent: keyof typeof PoolEvents

    Pool event.

    +
    diff --git a/docs/types/PoolType.html b/docs/types/PoolType.html index 1f701e23..995655c3 100644 --- a/docs/types/PoolType.html +++ b/docs/types/PoolType.html @@ -1,2 +1,2 @@ -PoolType | poolifier - v4.0.17

    Type Alias PoolType

    PoolType: keyof typeof PoolTypes

    Pool type.

    -
    \ No newline at end of file +PoolType | poolifier - v4.0.18

    Type Alias PoolType

    PoolType: keyof typeof PoolTypes

    Pool type.

    +
    diff --git a/docs/types/TaskAsyncFunction.html b/docs/types/TaskAsyncFunction.html index 4cc51776..881e6924 100644 --- a/docs/types/TaskAsyncFunction.html +++ b/docs/types/TaskAsyncFunction.html @@ -1,7 +1,7 @@ -TaskAsyncFunction | poolifier - v4.0.17

    Type Alias TaskAsyncFunction<Data, Response>

    TaskAsyncFunction<Data, Response>: ((data?: Data) => Promise<Response>)

    Task asynchronous function that can be executed. +TaskAsyncFunction | poolifier - v4.0.18

    Type Alias TaskAsyncFunction<Data, Response>

    TaskAsyncFunction<Data, Response>: ((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?): Promise<Response>
      • Parameters

        • Optionaldata: Data

          Data sent to the worker.

        Returns Promise<Response>

        Execution response promise.

        -
    \ No newline at end of file +
    diff --git a/docs/types/TaskFunction.html b/docs/types/TaskFunction.html index 03b337a5..1118a3a6 100644 --- a/docs/types/TaskFunction.html +++ b/docs/types/TaskFunction.html @@ -1,5 +1,5 @@ -TaskFunction | poolifier - v4.0.17

    Type Alias TaskFunction<Data, Response>

    Task function that can be executed. +TaskFunction | poolifier - v4.0.18

    Type Alias TaskFunction<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.

      -
    \ No newline at end of file +
    diff --git a/docs/types/TaskFunctions.html b/docs/types/TaskFunctions.html index a11668ee..99fa2e1d 100644 --- a/docs/types/TaskFunctions.html +++ b/docs/types/TaskFunctions.html @@ -1,6 +1,6 @@ -TaskFunctions | poolifier - v4.0.17

    Type Alias TaskFunctions<Data, Response>

    TaskFunctions<Data, Response>: Record<string, TaskFunction<Data, Response> | TaskFunctionObject<Data, Response>>

    Tasks functions that can be executed. +TaskFunctions | poolifier - v4.0.18

    Type Alias TaskFunctions<Data, Response>

    TaskFunctions<Data, Response>: 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.

      -
    \ No newline at end of file +
    diff --git a/docs/types/TaskSyncFunction.html b/docs/types/TaskSyncFunction.html index 089626f4..b1da4766 100644 --- a/docs/types/TaskSyncFunction.html +++ b/docs/types/TaskSyncFunction.html @@ -1,6 +1,6 @@ -TaskSyncFunction | poolifier - v4.0.17

    Type Alias TaskSyncFunction<Data, Response>

    TaskSyncFunction<Data, Response>: ((data?: Data) => Response)

    Task synchronous function that can be executed.

    +TaskSyncFunction | poolifier - v4.0.18

    Type Alias TaskSyncFunction<Data, Response>

    TaskSyncFunction<Data, Response>: ((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

      • (data?): Response
      • Parameters

        • Optionaldata: Data

          Data sent to the worker.

        Returns Response

        Execution response.

        -
    \ No newline at end of file +
    diff --git a/docs/types/ThreadPoolOptions.html b/docs/types/ThreadPoolOptions.html index da5378db..0791aecf 100644 --- a/docs/types/ThreadPoolOptions.html +++ b/docs/types/ThreadPoolOptions.html @@ -1,2 +1,2 @@ -ThreadPoolOptions | poolifier - v4.0.17

    Type Alias ThreadPoolOptions

    ThreadPoolOptions: PoolOptions<Worker>

    Options for a poolifier thread pool.

    -
    \ No newline at end of file +ThreadPoolOptions | poolifier - v4.0.18

    Type Alias ThreadPoolOptions

    ThreadPoolOptions: PoolOptions<Worker>

    Options for a poolifier thread pool.

    +
    diff --git a/docs/types/WorkerChoiceStrategy.html b/docs/types/WorkerChoiceStrategy.html index eeb480c3..fcad9d57 100644 --- a/docs/types/WorkerChoiceStrategy.html +++ b/docs/types/WorkerChoiceStrategy.html @@ -1,2 +1,2 @@ -WorkerChoiceStrategy | poolifier - v4.0.17

    Type Alias WorkerChoiceStrategy

    WorkerChoiceStrategy: keyof typeof WorkerChoiceStrategies

    Worker choice strategy.

    -
    \ No newline at end of file +WorkerChoiceStrategy | poolifier - v4.0.18

    Type Alias WorkerChoiceStrategy

    WorkerChoiceStrategy: keyof typeof WorkerChoiceStrategies

    Worker choice strategy.

    +
    diff --git a/docs/types/WorkerType.html b/docs/types/WorkerType.html index fdbb9f94..ce2f6a7e 100644 --- a/docs/types/WorkerType.html +++ b/docs/types/WorkerType.html @@ -1,2 +1,2 @@ -WorkerType | poolifier - v4.0.17

    Type Alias WorkerType

    WorkerType: keyof typeof WorkerTypes

    Worker type.

    -
    \ No newline at end of file +WorkerType | poolifier - v4.0.18

    Type Alias WorkerType

    WorkerType: keyof typeof WorkerTypes

    Worker type.

    +
    diff --git a/docs/types/Writable.html b/docs/types/Writable.html index 9987c1b2..56f06dec 100644 --- a/docs/types/Writable.html +++ b/docs/types/Writable.html @@ -1,3 +1,3 @@ -Writable | poolifier - v4.0.17

    Type Alias Writable<T>Internal

    Writable<T>: {
        -readonly [P in keyof T]: T[P]
    }

    Remove readonly modifier from all properties of T.

    +Writable | poolifier - v4.0.18

    Type Alias Writable<T>Internal

    Writable<T>: {
        -readonly [P in keyof T]: T[P]
    }

    Remove readonly modifier from all properties of T.

    Type Parameters

    • T

      Type to remove readonly modifier.

      -
    \ No newline at end of file +
    diff --git a/docs/variables/KillBehaviors.html b/docs/variables/KillBehaviors.html index 028dfec6..4a9cce2b 100644 --- a/docs/variables/KillBehaviors.html +++ b/docs/variables/KillBehaviors.html @@ -1,2 +1,2 @@ -KillBehaviors | poolifier - v4.0.17

    Variable KillBehaviorsConst

    KillBehaviors: Readonly<{
        HARD: "HARD";
        SOFT: "SOFT";
    }> = ...

    Enumeration of kill behaviors.

    -
    \ No newline at end of file +KillBehaviors | poolifier - v4.0.18

    Variable KillBehaviorsConst

    KillBehaviors: Readonly<{
        HARD: "HARD";
        SOFT: "SOFT";
    }> = ...

    Enumeration of kill behaviors.

    +
    diff --git a/docs/variables/Measurements.html b/docs/variables/Measurements.html index 13179d38..04d6dc69 100644 --- a/docs/variables/Measurements.html +++ b/docs/variables/Measurements.html @@ -1,2 +1,2 @@ -Measurements | poolifier - v4.0.17

    Variable MeasurementsConst

    Measurements: Readonly<{
        elu: "elu";
        runTime: "runTime";
        waitTime: "waitTime";
    }> = ...

    Enumeration of measurements.

    -
    \ No newline at end of file +Measurements | poolifier - v4.0.18

    Variable MeasurementsConst

    Measurements: Readonly<{
        elu: "elu";
        runTime: "runTime";
        waitTime: "waitTime";
    }> = ...

    Enumeration of measurements.

    +
    diff --git a/docs/variables/PoolEvents.html b/docs/variables/PoolEvents.html index 604ff381..f83a2909 100644 --- a/docs/variables/PoolEvents.html +++ b/docs/variables/PoolEvents.html @@ -1,2 +1,2 @@ -PoolEvents | poolifier - v4.0.17

    Variable PoolEventsConst

    PoolEvents: Readonly<{
        backPressure: "backPressure";
        busy: "busy";
        destroy: "destroy";
        empty: "empty";
        error: "error";
        full: "full";
        ready: "ready";
        taskError: "taskError";
    }> = ...

    Enumeration of pool events.

    -
    \ No newline at end of file +PoolEvents | poolifier - v4.0.18

    Variable PoolEventsConst

    PoolEvents: Readonly<{
        backPressure: "backPressure";
        busy: "busy";
        destroy: "destroy";
        empty: "empty";
        error: "error";
        full: "full";
        ready: "ready";
        taskError: "taskError";
    }> = ...

    Enumeration of pool events.

    +
    diff --git a/docs/variables/PoolTypes.html b/docs/variables/PoolTypes.html index 389d78c7..26842bc0 100644 --- a/docs/variables/PoolTypes.html +++ b/docs/variables/PoolTypes.html @@ -1,2 +1,2 @@ -PoolTypes | poolifier - v4.0.17

    Variable PoolTypesConst

    PoolTypes: Readonly<{
        dynamic: "dynamic";
        fixed: "fixed";
    }> = ...

    Enumeration of pool types.

    -
    \ No newline at end of file +PoolTypes | poolifier - v4.0.18

    Variable PoolTypesConst

    PoolTypes: Readonly<{
        dynamic: "dynamic";
        fixed: "fixed";
    }> = ...

    Enumeration of pool types.

    +
    diff --git a/docs/variables/WorkerChoiceStrategies.html b/docs/variables/WorkerChoiceStrategies.html index 903e1da3..3ad7f8b4 100644 --- a/docs/variables/WorkerChoiceStrategies.html +++ b/docs/variables/WorkerChoiceStrategies.html @@ -1,2 +1,2 @@ -WorkerChoiceStrategies | poolifier - v4.0.17

    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.

    -
    \ No newline at end of file +WorkerChoiceStrategies | poolifier - v4.0.18

    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/WorkerTypes.html b/docs/variables/WorkerTypes.html index 38e26481..57b71b47 100644 --- a/docs/variables/WorkerTypes.html +++ b/docs/variables/WorkerTypes.html @@ -1,2 +1,2 @@ -WorkerTypes | poolifier - v4.0.17

    Variable WorkerTypesConst

    WorkerTypes: Readonly<{
        cluster: "cluster";
        thread: "thread";
    }> = ...

    Enumeration of worker types.

    -
    \ No newline at end of file +WorkerTypes | poolifier - v4.0.18

    Variable WorkerTypesConst

    WorkerTypes: Readonly<{
        cluster: "cluster";
        thread: "thread";
    }> = ...

    Enumeration of worker types.

    +