Merge dependabot/npm_and_yarn/examples/typescript/websocket-server-pool/ws-hybrid...
[poolifier.git] / docs / classes / WorkerChoiceStrategiesContext.html
1 <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>WorkerChoiceStrategiesContext | poolifier - v4.0.10</title><meta name="description" content="Documentation for poolifier"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">poolifier - v4.0.10</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">poolifier</a></li><li><a href="WorkerChoiceStrategiesContext.html">WorkerChoiceStrategiesContext</a></li></ul><h1>Class WorkerChoiceStrategiesContext&lt;Worker, Data, Response&gt;</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>The worker choice strategies context.</p>
2 </div><div class="tsd-comment tsd-typography"></div></section> <section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="Worker" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Worker</span><span class="tsd-signature-keyword"> extends </span><a href="../interfaces/IWorker.html" class="tsd-signature-type tsd-kind-interface">IWorker</a></span><div class="tsd-comment tsd-typography"><p>Type of worker.</p>
3 </div><div class="tsd-comment tsd-typography"></div></li><li><span><a id="Data" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Data</span> = <span class="tsd-signature-type">unknown</span></span><div class="tsd-comment tsd-typography"><p>Type of data sent to the worker. This can only be structured-cloneable data.</p>
4 </div><div class="tsd-comment tsd-typography"></div></li><li><span><a id="Response" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Response</span> = <span class="tsd-signature-type">unknown</span></span><div class="tsd-comment tsd-typography"><p>Type of execution response. This can only be structured-cloneable data.</p>
5 </div><div class="tsd-comment tsd-typography"></div></li></ul></section> <aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L25">src/pools/selection-strategies/worker-choice-strategies-context.ts:25</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Constructors</h3><div class="tsd-index-list"><a href="WorkerChoiceStrategiesContext.html#constructor" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a>
6 </div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="WorkerChoiceStrategiesContext.html#defaultWorkerChoiceStrategy" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>default<wbr/>Worker<wbr/>Choice<wbr/>Strategy</span></a>
7 <a href="WorkerChoiceStrategiesContext.html#pool" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>pool</span></a>
8 <a href="WorkerChoiceStrategiesContext.html#retries" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>retries</span></a>
9 <a href="WorkerChoiceStrategiesContext.html#retriesCount" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>retries<wbr/>Count</span></a>
10 <a href="WorkerChoiceStrategiesContext.html#workerChoiceStrategies" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>worker<wbr/>Choice<wbr/>Strategies</span></a>
11 <a href="WorkerChoiceStrategiesContext.html#workerChoiceStrategiesPolicy" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>worker<wbr/>Choice<wbr/>Strategies<wbr/>Policy</span></a>
12 <a href="WorkerChoiceStrategiesContext.html#workerChoiceStrategiesTaskStatisticsRequirements" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>worker<wbr/>Choice<wbr/>Strategies<wbr/>Task<wbr/>Statistics<wbr/>Requirements</span></a>
13 </div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="WorkerChoiceStrategiesContext.html#addWorkerChoiceStrategy" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Worker<wbr/>Choice<wbr/>Strategy</span></a>
14 <a href="WorkerChoiceStrategiesContext.html#execute" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>execute</span></a>
15 <a href="WorkerChoiceStrategiesContext.html#executeStrategy" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>execute<wbr/>Strategy</span></a>
16 <a href="WorkerChoiceStrategiesContext.html#getPolicy" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Policy</span></a>
17 <a href="WorkerChoiceStrategiesContext.html#getTaskStatisticsRequirements" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Task<wbr/>Statistics<wbr/>Requirements</span></a>
18 <a href="WorkerChoiceStrategiesContext.html#remove" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove</span></a>
19 <a href="WorkerChoiceStrategiesContext.html#removeWorkerChoiceStrategy" class="tsd-index-link tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Worker<wbr/>Choice<wbr/>Strategy</span></a>
20 <a href="WorkerChoiceStrategiesContext.html#setDefaultWorkerChoiceStrategy" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Default<wbr/>Worker<wbr/>Choice<wbr/>Strategy</span></a>
21 <a href="WorkerChoiceStrategiesContext.html#setOptions" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Options</span></a>
22 <a href="WorkerChoiceStrategiesContext.html#syncWorkerChoiceStrategies" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>sync<wbr/>Worker<wbr/>Choice<wbr/>Strategies</span></a>
23 <a href="WorkerChoiceStrategiesContext.html#update" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>update</span></a>
24 </div></section></div></details></section></section><section class="tsd-panel-group tsd-member-group"><h2>Constructors</h2><section class="tsd-panel tsd-member"><a id="constructor" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="constructor.new_WorkerChoiceStrategiesContext" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Worker<wbr/>Choice<wbr/>Strategies<wbr/>Context</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Worker-1">Worker</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Data-1">Data</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Response-1">Response</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pool</span>, <span class="tsd-kind-parameter">workerChoiceStrategies</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="WorkerChoiceStrategiesContext.html" class="tsd-signature-type tsd-kind-class">WorkerChoiceStrategiesContext</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Worker-1">Worker</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Data-1">Data</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Response-1">Response</a><span class="tsd-signature-symbol">&gt;</span><a href="#constructor.new_WorkerChoiceStrategiesContext" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Worker choice strategies context constructor.</p>
25 </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="constructor.new_WorkerChoiceStrategiesContext.Worker-1" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Worker</span><span class="tsd-signature-keyword"> extends </span><a href="../interfaces/IWorker.html" class="tsd-signature-type tsd-kind-interface">IWorker</a></span></li><li><span><a id="constructor.new_WorkerChoiceStrategiesContext.Data-1" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Data</span> = <span class="tsd-signature-type">unknown</span></span></li><li><span><a id="constructor.new_WorkerChoiceStrategiesContext.Response-1" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Response</span> = <span class="tsd-signature-type">unknown</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">pool</span>: <a href="../interfaces/IPool.html" class="tsd-signature-type tsd-kind-interface">IPool</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Worker-1">Worker</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Data-1">Data</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Response-1">Response</a><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The pool instance.</p>
26 </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">workerChoiceStrategies</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-type">&quot;ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_USED&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_BUSY&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_ELU&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;FAIR_SHARE&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;WEIGHTED_ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;INTERLEAVED_WEIGHTED_ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = ...</span></span><div class="tsd-comment tsd-typography"><p>The worker choice strategies.</p>
27 </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">opts</span>: <a href="../interfaces/WorkerChoiceStrategyOptions.html" class="tsd-signature-type tsd-kind-interface">WorkerChoiceStrategyOptions</a></span><div class="tsd-comment tsd-typography"><p>The worker choice strategy options.</p>
28 </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="WorkerChoiceStrategiesContext.html" class="tsd-signature-type tsd-kind-class">WorkerChoiceStrategiesContext</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Worker-1">Worker</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Data-1">Data</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Response-1">Response</a><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"><h4>Default Value</h4><pre><code class="language-ts"><span class="hl-0">[</span><span class="hl-3">WorkerChoiceStrategies</span><span class="hl-0">.</span><span class="hl-5">ROUND_ROBIN</span><span class="hl-0">]</span>
29 </code><button>Copy</button></pre>
30 </div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L70">src/pools/selection-strategies/worker-choice-strategies-context.ts:70</a></li></ul></aside></li></ul></section></section><section class="tsd-panel-group tsd-member-group"><h2>Properties</h2><section class="tsd-panel tsd-member tsd-is-private"><a id="defaultWorkerChoiceStrategy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>default<wbr/>Worker<wbr/>Choice<wbr/>Strategy</span><a href="#defaultWorkerChoiceStrategy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">default<wbr/>Worker<wbr/>Choice<wbr/>Strategy</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_USED&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_BUSY&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_ELU&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;FAIR_SHARE&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;WEIGHTED_ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;INTERLEAVED_WEIGHTED_ROUND_ROBIN&quot;</span></div><div class="tsd-comment tsd-typography"><p>The default worker choice strategy in the context.</p>
31 </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L38">src/pools/selection-strategies/worker-choice-strategies-context.ts:38</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-private"><a id="pool" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>pool</span><a href="#pool" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">pool</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/IPool.html" class="tsd-signature-type tsd-kind-interface">IPool</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Worker-1">Worker</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Data-1">Data</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Response-1">Response</a><span class="tsd-signature-symbol">&gt;</span></div><div class="tsd-comment tsd-typography"><p>The pool instance.</p>
32 </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L71">src/pools/selection-strategies/worker-choice-strategies-context.ts:71</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-private"><a id="retries" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>retries</span><a href="#retries" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">retries</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>The maximum number of worker choice strategies execution retries.</p>
33 </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L61">src/pools/selection-strategies/worker-choice-strategies-context.ts:61</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="retriesCount" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>retries<wbr/>Count</span><a href="#retriesCount" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">retries<wbr/>Count</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>The number of worker choice strategies execution retries.</p>
34 </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L33">src/pools/selection-strategies/worker-choice-strategies-context.ts:33</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-private"><a id="workerChoiceStrategies" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>worker<wbr/>Choice<wbr/>Strategies</span><a href="#workerChoiceStrategies" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">worker<wbr/>Choice<wbr/>Strategies</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">&quot;ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_USED&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_BUSY&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_ELU&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;FAIR_SHARE&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;WEIGHTED_ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;INTERLEAVED_WEIGHTED_ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol">, </span><a href="../interfaces/IWorkerChoiceStrategy.html" class="tsd-signature-type tsd-kind-interface">IWorkerChoiceStrategy</a><span class="tsd-signature-symbol">&gt;</span></div><div class="tsd-comment tsd-typography"><p>The worker choice strategies registered in the context.</p>
35 </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L43">src/pools/selection-strategies/worker-choice-strategies-context.ts:43</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-private"><a id="workerChoiceStrategiesPolicy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>worker<wbr/>Choice<wbr/>Strategies<wbr/>Policy</span><a href="#workerChoiceStrategiesPolicy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">worker<wbr/>Choice<wbr/>Strategies<wbr/>Policy</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/StrategyPolicy.html" class="tsd-signature-type tsd-kind-interface">StrategyPolicy</a></div><div class="tsd-comment tsd-typography"><p>The active worker choice strategies in the context policy.</p>
36 </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L51">src/pools/selection-strategies/worker-choice-strategies-context.ts:51</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-private"><a id="workerChoiceStrategiesTaskStatisticsRequirements" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>worker<wbr/>Choice<wbr/>Strategies<wbr/>Task<wbr/>Statistics<wbr/>Requirements</span><a href="#workerChoiceStrategiesTaskStatisticsRequirements" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">worker<wbr/>Choice<wbr/>Strategies<wbr/>Task<wbr/>Statistics<wbr/>Requirements</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/TaskStatisticsRequirements.html" class="tsd-signature-type tsd-kind-interface">TaskStatisticsRequirements</a></div><div class="tsd-comment tsd-typography"><p>The active worker choice strategies in the context task statistics requirements.</p>
37 </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L56">src/pools/selection-strategies/worker-choice-strategies-context.ts:56</a></li></ul></aside></section></section><section class="tsd-panel-group tsd-member-group"><h2>Methods</h2><section class="tsd-panel tsd-member tsd-is-private"><a id="addWorkerChoiceStrategy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>add<wbr/>Worker<wbr/>Choice<wbr/>Strategy</span><a href="#addWorkerChoiceStrategy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-private"><li class="tsd-signature tsd-anchor-link"><a id="addWorkerChoiceStrategy.addWorkerChoiceStrategy-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">add<wbr/>Worker<wbr/>Choice<wbr/>Strategy</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">workerChoiceStrategy</span>, <span class="tsd-kind-parameter">pool</span>, <span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">&quot;ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_USED&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_BUSY&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_ELU&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;FAIR_SHARE&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;WEIGHTED_ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;INTERLEAVED_WEIGHTED_ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol">, </span><a href="../interfaces/IWorkerChoiceStrategy.html" class="tsd-signature-type tsd-kind-interface">IWorkerChoiceStrategy</a><span class="tsd-signature-symbol">&gt;</span><a href="#addWorkerChoiceStrategy.addWorkerChoiceStrategy-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Adds a worker choice strategy to the context.</p>
38 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">workerChoiceStrategy</span>: <span class="tsd-signature-type">&quot;ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_USED&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_BUSY&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_ELU&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;FAIR_SHARE&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;WEIGHTED_ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;INTERLEAVED_WEIGHTED_ROUND_ROBIN&quot;</span></span><div class="tsd-comment tsd-typography"><p>The worker choice strategy to add.</p>
39 </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">pool</span>: <a href="../interfaces/IPool.html" class="tsd-signature-type tsd-kind-interface">IPool</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Worker-1">Worker</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Data-1">Data</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="WorkerChoiceStrategiesContext.html#constructor.new_WorkerChoiceStrategiesContext.Response-1">Response</a><span class="tsd-signature-symbol">&gt;</span></span></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">opts</span>: <a href="../interfaces/WorkerChoiceStrategyOptions.html" class="tsd-signature-type tsd-kind-interface">WorkerChoiceStrategyOptions</a></span><div class="tsd-comment tsd-typography"><p>The worker choice strategy options.</p>
40 </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">&quot;ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_USED&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_BUSY&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_ELU&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;FAIR_SHARE&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;WEIGHTED_ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;INTERLEAVED_WEIGHTED_ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol">, </span><a href="../interfaces/IWorkerChoiceStrategy.html" class="tsd-signature-type tsd-kind-interface">IWorkerChoiceStrategy</a><span class="tsd-signature-symbol">&gt;</span></h4><p>The worker choice strategies.</p>
41 <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L250">src/pools/selection-strategies/worker-choice-strategies-context.ts:250</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="execute" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>execute</span><a href="#execute" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="execute.execute-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">execute</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">workerChoiceStrategy</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><a href="#execute.execute-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Executes the given worker choice strategy in the context algorithm.</p>
42 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">workerChoiceStrategy</span>: <span class="tsd-signature-type">&quot;ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_USED&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_BUSY&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_ELU&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;FAIR_SHARE&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;WEIGHTED_ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;INTERLEAVED_WEIGHTED_ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> = ...</span></span><div class="tsd-comment tsd-typography"><p>The worker choice strategy algorithm to execute.</p>
43 </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><p>The key of the worker node.</p>
44 <div class="tsd-comment tsd-typography"><h4>Default Value</h4><pre><code class="language-ts"><span class="hl-4">this</span><span class="hl-0">.</span><span class="hl-3">defaultWorkerChoiceStrategy</span>
45 </code><button>Copy</button></pre>
46 <h4>Throws</h4><p><a href="https://nodejs.org/api/errors.html#class-error">https://nodejs.org/api/errors.html#class-error</a> If after computed retries the worker node key is null or undefined.</p>
47 </div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L153">src/pools/selection-strategies/worker-choice-strategies-context.ts:153</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-private"><a id="executeStrategy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>execute<wbr/>Strategy</span><a href="#executeStrategy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-private"><li class="tsd-signature tsd-anchor-link"><a id="executeStrategy.executeStrategy-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">execute<wbr/>Strategy</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">workerChoiceStrategy</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><a href="#executeStrategy.executeStrategy-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Executes the given worker choice strategy.</p>
48 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">workerChoiceStrategy</span>: <a href="../interfaces/IWorkerChoiceStrategy.html" class="tsd-signature-type tsd-kind-interface">IWorkerChoiceStrategy</a></span><div class="tsd-comment tsd-typography"><p>The worker choice strategy.</p>
49 </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><p>The key of the worker node.</p>
50 <div class="tsd-comment tsd-typography"><h4>Throws</h4><p><a href="https://nodejs.org/api/errors.html#class-error">https://nodejs.org/api/errors.html#class-error</a> If after computed retries the worker node key is null or undefined.</p>
51 </div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L170">src/pools/selection-strategies/worker-choice-strategies-context.ts:170</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getPolicy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Policy</span><a href="#getPolicy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getPolicy.getPolicy-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Policy</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/StrategyPolicy.html" class="tsd-signature-type tsd-kind-interface">StrategyPolicy</a><a href="#getPolicy.getPolicy-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets the active worker choice strategies in the context policy.</p>
52 </div><h4 class="tsd-returns-title">Returns <a href="../interfaces/StrategyPolicy.html" class="tsd-signature-type tsd-kind-interface">StrategyPolicy</a></h4><p>The strategies policy.</p>
53 <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L105">src/pools/selection-strategies/worker-choice-strategies-context.ts:105</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="getTaskStatisticsRequirements" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>get<wbr/>Task<wbr/>Statistics<wbr/>Requirements</span><a href="#getTaskStatisticsRequirements" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="getTaskStatisticsRequirements.getTaskStatisticsRequirements-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Task<wbr/>Statistics<wbr/>Requirements</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/TaskStatisticsRequirements.html" class="tsd-signature-type tsd-kind-interface">TaskStatisticsRequirements</a><a href="#getTaskStatisticsRequirements.getTaskStatisticsRequirements-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Gets the active worker choice strategies in the context task statistics requirements.</p>
54 </div><h4 class="tsd-returns-title">Returns <a href="../interfaces/TaskStatisticsRequirements.html" class="tsd-signature-type tsd-kind-interface">TaskStatisticsRequirements</a></h4><p>The strategies task statistics requirements.</p>
55 <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L114">src/pools/selection-strategies/worker-choice-strategies-context.ts:114</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="remove" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>remove</span><a href="#remove" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="remove.remove-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">workerNodeKey</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#remove.remove-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Removes the worker node key from the active worker choice strategies in the context.</p>
56 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">workerNodeKey</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The worker node key.</p>
57 </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p><code>true</code> if the removal is successful, <code>false</code> otherwise.</p>
58 <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L196">src/pools/selection-strategies/worker-choice-strategies-context.ts:196</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-private"><a id="removeWorkerChoiceStrategy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <span>remove<wbr/>Worker<wbr/>Choice<wbr/>Strategy</span><a href="#removeWorkerChoiceStrategy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-private"><li class="tsd-signature tsd-anchor-link"><a id="removeWorkerChoiceStrategy.removeWorkerChoiceStrategy-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove<wbr/>Worker<wbr/>Choice<wbr/>Strategy</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">workerChoiceStrategy</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#removeWorkerChoiceStrategy.removeWorkerChoiceStrategy-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Removes a worker choice strategy from the context.</p>
59 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">workerChoiceStrategy</span>: <span class="tsd-signature-type">&quot;ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_USED&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_BUSY&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_ELU&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;FAIR_SHARE&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;WEIGHTED_ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;INTERLEAVED_WEIGHTED_ROUND_ROBIN&quot;</span></span><div class="tsd-comment tsd-typography"><p>The worker choice strategy to remove.</p>
60 </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p><code>true</code> if the worker choice strategy is removed, <code>false</code> otherwise.</p>
61 <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L275">src/pools/selection-strategies/worker-choice-strategies-context.ts:275</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="setDefaultWorkerChoiceStrategy" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>Default<wbr/>Worker<wbr/>Choice<wbr/>Strategy</span><a href="#setDefaultWorkerChoiceStrategy" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="setDefaultWorkerChoiceStrategy.setDefaultWorkerChoiceStrategy-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">set<wbr/>Default<wbr/>Worker<wbr/>Choice<wbr/>Strategy</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">workerChoiceStrategy</span>, <span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#setDefaultWorkerChoiceStrategy.setDefaultWorkerChoiceStrategy-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Sets the default worker choice strategy to use in the context.</p>
62 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">workerChoiceStrategy</span>: <span class="tsd-signature-type">&quot;ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_USED&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_BUSY&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_ELU&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;FAIR_SHARE&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;WEIGHTED_ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;INTERLEAVED_WEIGHTED_ROUND_ROBIN&quot;</span></span><div class="tsd-comment tsd-typography"><p>The default worker choice strategy to set.</p>
63 </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">opts</span>: <a href="../interfaces/WorkerChoiceStrategyOptions.html" class="tsd-signature-type tsd-kind-interface">WorkerChoiceStrategyOptions</a></span><div class="tsd-comment tsd-typography"><p>The worker choice strategy options.</p>
64 </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L124">src/pools/selection-strategies/worker-choice-strategies-context.ts:124</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="setOptions" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>Options</span><a href="#setOptions" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="setOptions.setOptions-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">set<wbr/>Options</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#setOptions.setOptions-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Sets the active worker choice strategies in the context options.</p>
65 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">opts</span>: <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/WorkerChoiceStrategyOptions.html" class="tsd-signature-type tsd-kind-interface">WorkerChoiceStrategyOptions</a></span><div class="tsd-comment tsd-typography"><p>The worker choice strategy options.</p>
66 </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L208">src/pools/selection-strategies/worker-choice-strategies-context.ts:208</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="syncWorkerChoiceStrategies" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>sync<wbr/>Worker<wbr/>Choice<wbr/>Strategies</span><a href="#syncWorkerChoiceStrategies" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="syncWorkerChoiceStrategies.syncWorkerChoiceStrategies-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">sync<wbr/>Worker<wbr/>Choice<wbr/>Strategies</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">workerChoiceStrategies</span>, <span class="tsd-kind-parameter">opts</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#syncWorkerChoiceStrategies.syncWorkerChoiceStrategies-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Synchronizes the active worker choice strategies in the context with the given worker choice strategies.</p>
67 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">workerChoiceStrategies</span>: <span class="tsd-signature-type">Set</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">&quot;ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_USED&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_BUSY&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LEAST_ELU&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;FAIR_SHARE&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;WEIGHTED_ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;INTERLEAVED_WEIGHTED_ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The worker choice strategies to synchronize.</p>
68 </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">opts</span>: <a href="../interfaces/WorkerChoiceStrategyOptions.html" class="tsd-signature-type tsd-kind-interface">WorkerChoiceStrategyOptions</a></span><div class="tsd-comment tsd-typography"><p>The worker choice strategy options.</p>
69 </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L220">src/pools/selection-strategies/worker-choice-strategies-context.ts:220</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member"><a id="update" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>update</span><a href="#update" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="update.update-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">update</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">workerNodeKey</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#update.update-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Updates the worker node key in the active worker choice strategies in the context internals.</p>
70 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">workerNodeKey</span>: <span class="tsd-signature-type">number</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p><code>true</code> if the update is successful, <code>false</code> otherwise.</p>
71 <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/40d04d55ce29490e98226cfe968df9502755782d/src/pools/selection-strategies/worker-choice-strategies-context.ts#L139">src/pools/selection-strategies/worker-choice-strategies-context.ts:139</a></li></ul></aside></li></ul></section></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#constructor" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-512"></use></svg><span>constructor</span></a><a href="#defaultWorkerChoiceStrategy" class="tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>default<wbr/>Worker<wbr/>Choice<wbr/>Strategy</span></a><a href="#pool" class="tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>pool</span></a><a href="#retries" class="tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>retries</span></a><a href="#retriesCount" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>retries<wbr/>Count</span></a><a href="#workerChoiceStrategies" class="tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>worker<wbr/>Choice<wbr/>Strategies</span></a><a href="#workerChoiceStrategiesPolicy" class="tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>worker<wbr/>Choice<wbr/>Strategies<wbr/>Policy</span></a><a href="#workerChoiceStrategiesTaskStatisticsRequirements" class="tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>worker<wbr/>Choice<wbr/>Strategies<wbr/>Task<wbr/>Statistics<wbr/>Requirements</span></a><a href="#addWorkerChoiceStrategy" class="tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Worker<wbr/>Choice<wbr/>Strategy</span></a><a href="#execute" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>execute</span></a><a href="#executeStrategy" class="tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>execute<wbr/>Strategy</span></a><a href="#getPolicy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Policy</span></a><a href="#getTaskStatisticsRequirements" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Task<wbr/>Statistics<wbr/>Requirements</span></a><a href="#remove" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove</span></a><a href="#removeWorkerChoiceStrategy" class="tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Worker<wbr/>Choice<wbr/>Strategy</span></a><a href="#setDefaultWorkerChoiceStrategy" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Default<wbr/>Worker<wbr/>Choice<wbr/>Strategy</span></a><a href="#setOptions" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Options</span></a><a href="#syncWorkerChoiceStrategies" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>sync<wbr/>Worker<wbr/>Choice<wbr/>Strategies</span></a><a href="#update" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>update</span></a></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>poolifier - v4.0.10</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>