docs: generate documentation
[poolifier.git] / docs / classes / ThreadWorker.html
1 <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ThreadWorker | poolifier - v3.1.22</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 - v3.1.22</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="ThreadWorker.html">ThreadWorker</a></li></ul><h1>Class ThreadWorker&lt;Data, Response&gt;</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>A thread worker used by a poolifier <code>ThreadPool</code>.</p>
2 <p>When this worker is inactive for more than the given <code>maxInactiveTime</code>,
3 it will send a termination request to its main thread.</p>
4 <p>If you use a <code>DynamicThreadPool</code> the extra workers that were created will be terminated,
5 but the minimum number of workers will be guaranteed.</p>
6 </div><div class="tsd-comment tsd-typography"><h4>Author</h4><p><a href="https://github.com/pioardi">Alessandro Pio Ardizio</a></p>
7 <h4>Since</h4><p>0.0.1</p>
8 </div></section> <section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><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 this worker receives from pool&#39;s execution. This can only be structured-cloneable data.</p>
9 </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 response the worker sends back to the main thread. This can only be structured-cloneable data.</p>
10 </div><div class="tsd-comment tsd-typography"></div></li></ul></section> <section class="tsd-panel tsd-hierarchy"><h4>Hierarchy (<a class="link" href="../hierarchy.html#ThreadWorker">view full</a>)</h4><ul class="tsd-hierarchy"><li><a href="AbstractWorker.html" class="tsd-signature-type tsd-kind-class">AbstractWorker</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">MessagePort</span><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Data-1">Data</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Response-1">Response</a><span class="tsd-signature-symbol">&gt;</span><ul class="tsd-hierarchy"><li><span class="target">ThreadWorker</span></li></ul></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/thread-worker.ts#L27">src/worker/thread-worker.ts:27</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="ThreadWorker.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>
11 </div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="ThreadWorker.html#activeInterval" class="tsd-index-link tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>active<wbr/>Interval?</span></a>
12 <a href="ThreadWorker.html#isMain" class="tsd-index-link tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>is<wbr/>Main</span></a>
13 <a href="ThreadWorker.html#lastTaskTimestamp" class="tsd-index-link tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>last<wbr/>Task<wbr/>Timestamp</span></a>
14 <a href="ThreadWorker.html#opts" class="tsd-index-link tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>opts</span></a>
15 <a href="ThreadWorker.html#port" 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>port?</span></a>
16 <a href="ThreadWorker.html#statistics" class="tsd-index-link tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>statistics?</span></a>
17 <a href="ThreadWorker.html#taskFunctions" class="tsd-index-link tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>task<wbr/>Functions</span></a>
18 </div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Accessors</h3><div class="tsd-index-list"><a href="ThreadWorker.html#id" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>id</span></a>
19 </div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="ThreadWorker.html#addTaskFunction" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Task<wbr/>Function</span></a>
20 <a href="ThreadWorker.html#getMainWorker" class="tsd-index-link tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Main<wbr/>Worker</span></a>
21 <a href="ThreadWorker.html#handleError" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>handle<wbr/>Error</span></a>
22 <a href="ThreadWorker.html#handleKillMessage" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>handle<wbr/>Kill<wbr/>Message</span></a>
23 <a href="ThreadWorker.html#handleReadyMessage" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>handle<wbr/>Ready<wbr/>Message</span></a>
24 <a href="ThreadWorker.html#handleTaskFunctionOperationMessage" class="tsd-index-link tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>handle<wbr/>Task<wbr/>Function<wbr/>Operation<wbr/>Message</span></a>
25 <a href="ThreadWorker.html#hasTaskFunction" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>has<wbr/>Task<wbr/>Function</span></a>
26 <a href="ThreadWorker.html#listTaskFunctionNames" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>list<wbr/>Task<wbr/>Function<wbr/>Names</span></a>
27 <a href="ThreadWorker.html#messageListener" class="tsd-index-link tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>message<wbr/>Listener</span></a>
28 <a href="ThreadWorker.html#removeTaskFunction" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Task<wbr/>Function</span></a>
29 <a href="ThreadWorker.html#run" class="tsd-index-link tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>run</span></a>
30 <a href="ThreadWorker.html#runAsync" class="tsd-index-link tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>run<wbr/>Async</span></a>
31 <a href="ThreadWorker.html#runSync" class="tsd-index-link tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>run<wbr/>Sync</span></a>
32 <a href="ThreadWorker.html#sendTaskFunctionNamesToMainWorker" class="tsd-index-link tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>send<wbr/>Task<wbr/>Function<wbr/>Names<wbr/>To<wbr/>Main<wbr/>Worker</span></a>
33 <a href="ThreadWorker.html#sendToMainWorker" class="tsd-index-link tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>send<wbr/>To<wbr/>Main<wbr/>Worker</span></a>
34 <a href="ThreadWorker.html#setDefaultTaskFunction" class="tsd-index-link tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Default<wbr/>Task<wbr/>Function</span></a>
35 </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_ThreadWorker" class="tsd-anchor"></a><span class="tsd-kind-constructor-signature">new <wbr/>Thread<wbr/>Worker</span><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Data-1">Data</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Response-1">Response</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">taskFunctions</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="ThreadWorker.html" class="tsd-signature-type tsd-kind-class">ThreadWorker</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Data-1">Data</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Response-1">Response</a><span class="tsd-signature-symbol">&gt;</span><a href="#constructor.new_ThreadWorker" 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>Constructs a new poolifier thread worker.</p>
36 </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="constructor.new_ThreadWorker.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_ThreadWorker.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">taskFunctions</span>: <a href="../types/TaskFunction.html" class="tsd-signature-type tsd-kind-type-alias">TaskFunction</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Data-1">Data</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Response-1">Response</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> | </span><a href="../types/TaskFunctions.html" class="tsd-signature-type tsd-kind-type-alias">TaskFunctions</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Data-1">Data</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Response-1">Response</a><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>Task function(s) processed by the worker when the pool&#39;s <code>execution</code> function is invoked.</p>
37 </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">opts</span>: <a href="../interfaces/WorkerOptions.html" class="tsd-signature-type tsd-kind-interface">WorkerOptions</a><span class="tsd-signature-symbol"> = {}</span></span><div class="tsd-comment tsd-typography"><p>Options for the worker.</p>
38 </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="ThreadWorker.html" class="tsd-signature-type tsd-kind-class">ThreadWorker</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Data-1">Data</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Response-1">Response</a><span class="tsd-signature-symbol">&gt;</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Overrides <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#constructor">constructor</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/thread-worker.ts#L42">src/worker/thread-worker.ts:42</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-protected tsd-is-inherited"><a id="activeInterval" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <code class="tsd-tag ts-flagOptional">Optional</code> <span>active<wbr/>Interval</span><a href="#activeInterval" 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">active<wbr/>Interval</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">Timeout</span></div><div class="tsd-comment tsd-typography"><p>Handler id of the <code>activeInterval</code> worker activity check.</p>
39 </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#activeInterval">activeInterval</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L79">src/worker/abstract-worker.ts:79</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="isMain" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>is<wbr/>Main</span><a href="#isMain" 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">is<wbr/>Main</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">boolean</span></div><div class="tsd-comment tsd-typography"><p>Whether this is the main worker or not.</p>
40 </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#isMain">isMain</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L90">src/worker/abstract-worker.ts:90</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="lastTaskTimestamp" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>last<wbr/>Task<wbr/>Timestamp</span><a href="#lastTaskTimestamp" 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">last<wbr/>Task<wbr/>Timestamp</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>Timestamp of the last task processed by this worker.</p>
41 </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#lastTaskTimestamp">lastTaskTimestamp</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L71">src/worker/abstract-worker.ts:71</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="opts" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>opts</span><a href="#opts" 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">opts</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/WorkerOptions.html" class="tsd-signature-type tsd-kind-interface">WorkerOptions</a><span class="tsd-signature-symbol"> = DEFAULT_WORKER_OPTIONS</span></div><div class="tsd-comment tsd-typography"><p>Options for the worker.</p>
42 </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#opts">opts</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L93">src/worker/abstract-worker.ts:93</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-private"><a id="port" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagPrivate">Private</code> <code class="tsd-tag ts-flagOptional">Optional</code> <span>port</span><a href="#port" 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">port</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">MessagePort</span></div><div class="tsd-comment tsd-typography"><p>Message port used to communicate with the main worker.</p>
43 </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/thread-worker.ts#L34">src/worker/thread-worker.ts:34</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="statistics" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <code class="tsd-tag ts-flagOptional">Optional</code> <span>statistics</span><a href="#statistics" 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">statistics</span><span class="tsd-signature-symbol">?:</span> <a href="../interfaces/WorkerStatistics.html" class="tsd-signature-type tsd-kind-interface">WorkerStatistics</a></div><div class="tsd-comment tsd-typography"><p>Performance statistics computation requirements.</p>
44 </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#statistics">statistics</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L75">src/worker/abstract-worker.ts:75</a></li></ul></aside></section><section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="taskFunctions" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>task<wbr/>Functions</span><a href="#taskFunctions" 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">task<wbr/>Functions</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">string</span><span class="tsd-signature-symbol">, </span><a href="../types/TaskFunction.html" class="tsd-signature-type tsd-kind-type-alias">TaskFunction</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Data-1">Data</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Response-1">Response</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</span></div><div class="tsd-comment tsd-typography"><p>Task function(s) processed by the worker when the pool&#39;s <code>execution</code> function is invoked.</p>
45 </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#taskFunctions">taskFunctions</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L67">src/worker/abstract-worker.ts:67</a></li></ul></aside></section></section><section class="tsd-panel-group tsd-member-group"><h2>Accessors</h2><section class="tsd-panel tsd-member tsd-is-protected"><a id="id" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>id</span><a href="#id" 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-protected"><li class="tsd-signature" id="id.id-1"><span class="tsd-signature-keyword">get</span> id<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></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Worker id.</p>
46 </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Overrides AbstractWorker.id</p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/thread-worker.ts#L80">src/worker/thread-worker.ts:80</a></li></ul></aside></li></ul></section></section><section class="tsd-panel-group tsd-member-group"><h2>Methods</h2><section class="tsd-panel tsd-member tsd-is-inherited"><a id="addTaskFunction" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>add<wbr/>Task<wbr/>Function</span><a href="#addTaskFunction" 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-inherited"><li class="tsd-signature tsd-anchor-link"><a id="addTaskFunction.addTaskFunction-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">add<wbr/>Task<wbr/>Function</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">name</span>, <span class="tsd-kind-parameter">fn</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/TaskFunctionOperationResult.html" class="tsd-signature-type tsd-kind-interface">TaskFunctionOperationResult</a><a href="#addTaskFunction.addTaskFunction-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 task function to the worker.
47 If a task function with the same name already exists, it is replaced.</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">name</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The name of the task function to add.</p>
49 </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">fn</span>: <a href="../types/TaskFunction.html" class="tsd-signature-type tsd-kind-type-alias">TaskFunction</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Data-1">Data</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Response-1">Response</a><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The task function to add.</p>
50 </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../interfaces/TaskFunctionOperationResult.html" class="tsd-signature-type tsd-kind-interface">TaskFunctionOperationResult</a></h4><p>Whether the task function was added or not.</p>
51 <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#addTaskFunction">addTaskFunction</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L180">src/worker/abstract-worker.ts:180</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="getMainWorker" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>get<wbr/>Main<wbr/>Worker</span><a href="#getMainWorker" 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-protected tsd-is-inherited"><li class="tsd-signature tsd-anchor-link"><a id="getMainWorker.getMainWorker-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">get<wbr/>Main<wbr/>Worker</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">MessagePort</span><a href="#getMainWorker.getMainWorker-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>Returns the main worker.</p>
52 </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">MessagePort</span></h4><p>Reference to the main worker.</p>
53 <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 the main worker is not set.</p>
54 </div><aside class="tsd-sources"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#getMainWorker">getMainWorker</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L452">src/worker/abstract-worker.ts:452</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-protected"><a id="handleError" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>handle<wbr/>Error</span><a href="#handleError" 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-protected"><li class="tsd-signature tsd-anchor-link"><a id="handleError.handleError-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">handle<wbr/>Error</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><a href="#handleError.handleError-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>Handles an error and convert it to a string so it can be sent back to the main worker.</p>
55 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">error</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Error</span></span><div class="tsd-comment tsd-typography"><p>The error raised by the worker.</p>
56 </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><p>The error message.</p>
57 <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Overrides <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#handleError">handleError</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/thread-worker.ts#L98">src/worker/thread-worker.ts:98</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-protected"><a id="handleKillMessage" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>handle<wbr/>Kill<wbr/>Message</span><a href="#handleKillMessage" 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-protected"><li class="tsd-signature tsd-anchor-link"><a id="handleKillMessage.handleKillMessage-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">handle<wbr/>Kill<wbr/>Message</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">message</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#handleKillMessage.handleKillMessage-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>Handles a kill message sent by the main worker.</p>
58 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">message</span>: <a href="../interfaces/MessageValue.html" class="tsd-signature-type tsd-kind-interface">MessageValue</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Data-1">Data</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">&gt;</span></span></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"><p>Overrides <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#handleKillMessage">handleKillMessage</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/thread-worker.ts#L73">src/worker/thread-worker.ts:73</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-protected"><a id="handleReadyMessage" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>handle<wbr/>Ready<wbr/>Message</span><a href="#handleReadyMessage" 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-protected"><li class="tsd-signature tsd-anchor-link"><a id="handleReadyMessage.handleReadyMessage-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">handle<wbr/>Ready<wbr/>Message</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">message</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#handleReadyMessage.handleReadyMessage-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>Handles the ready message sent by the main worker.</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">message</span>: <a href="../interfaces/MessageValue.html" class="tsd-signature-type tsd-kind-interface">MessageValue</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Data-1">Data</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The ready message.</p>
60 </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"><p>Overrides <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#handleReadyMessage">handleReadyMessage</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/thread-worker.ts#L50">src/worker/thread-worker.ts:50</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="handleTaskFunctionOperationMessage" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>handle<wbr/>Task<wbr/>Function<wbr/>Operation<wbr/>Message</span><a href="#handleTaskFunctionOperationMessage" 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-protected tsd-is-inherited"><li class="tsd-signature tsd-anchor-link"><a id="handleTaskFunctionOperationMessage.handleTaskFunctionOperationMessage-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">handle<wbr/>Task<wbr/>Function<wbr/>Operation<wbr/>Message</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">message</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#handleTaskFunctionOperationMessage.handleTaskFunctionOperationMessage-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-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">message</span>: <a href="../interfaces/MessageValue.html" class="tsd-signature-type tsd-kind-interface">MessageValue</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Data-1">Data</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">&gt;</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#handleTaskFunctionOperationMessage">handleTaskFunctionOperationMessage</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L325">src/worker/abstract-worker.ts:325</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited"><a id="hasTaskFunction" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>has<wbr/>Task<wbr/>Function</span><a href="#hasTaskFunction" 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-inherited"><li class="tsd-signature tsd-anchor-link"><a id="hasTaskFunction.hasTaskFunction-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">has<wbr/>Task<wbr/>Function</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/TaskFunctionOperationResult.html" class="tsd-signature-type tsd-kind-interface">TaskFunctionOperationResult</a><a href="#hasTaskFunction.hasTaskFunction-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>Checks if the worker has a task function with the given name.</p>
61 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">name</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The name of the task function to check.</p>
62 </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../interfaces/TaskFunctionOperationResult.html" class="tsd-signature-type tsd-kind-interface">TaskFunctionOperationResult</a></h4><p>Whether the worker has a task function with the given name or not.</p>
63 <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#hasTaskFunction">hasTaskFunction</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L163">src/worker/abstract-worker.ts:163</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited"><a id="listTaskFunctionNames" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>list<wbr/>Task<wbr/>Function<wbr/>Names</span><a href="#listTaskFunctionNames" 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-inherited"><li class="tsd-signature tsd-anchor-link"><a id="listTaskFunctionNames.listTaskFunctionNames-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">list<wbr/>Task<wbr/>Function<wbr/>Names</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><a href="#listTaskFunctionNames.listTaskFunctionNames-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>Lists the names of the worker&#39;s task functions.</p>
64 </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4><p>The names of the worker&#39;s task functions.</p>
65 <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#listTaskFunctionNames">listTaskFunctionNames</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L244">src/worker/abstract-worker.ts:244</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="messageListener" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>message<wbr/>Listener</span><a href="#messageListener" 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-protected tsd-is-inherited"><li class="tsd-signature tsd-anchor-link"><a id="messageListener.messageListener-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">message<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">message</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#messageListener.messageListener-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>Worker message listener.</p>
66 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">message</span>: <a href="../interfaces/MessageValue.html" class="tsd-signature-type tsd-kind-interface">MessageValue</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Data-1">Data</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The received message.</p>
67 </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"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#messageListener">messageListener</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L305">src/worker/abstract-worker.ts:305</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited"><a id="removeTaskFunction" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>remove<wbr/>Task<wbr/>Function</span><a href="#removeTaskFunction" 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-inherited"><li class="tsd-signature tsd-anchor-link"><a id="removeTaskFunction.removeTaskFunction-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove<wbr/>Task<wbr/>Function</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/TaskFunctionOperationResult.html" class="tsd-signature-type tsd-kind-interface">TaskFunctionOperationResult</a><a href="#removeTaskFunction.removeTaskFunction-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 task function from the worker.</p>
68 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">name</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The name of the task function to remove.</p>
69 </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../interfaces/TaskFunctionOperationResult.html" class="tsd-signature-type tsd-kind-interface">TaskFunctionOperationResult</a></h4><p>Whether the task function existed and was removed or not.</p>
70 <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#removeTaskFunction">removeTaskFunction</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L215">src/worker/abstract-worker.ts:215</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="run" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>run</span><a href="#run" 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-protected tsd-is-inherited"><li class="tsd-signature tsd-anchor-link"><a id="run.run-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">run</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">task</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#run.run-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>Runs the given task.</p>
71 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">task</span>: <a href="../interfaces/Task.html" class="tsd-signature-type tsd-kind-interface">Task</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Data-1">Data</a><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The task to execute.</p>
72 </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"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#run">run</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L492">src/worker/abstract-worker.ts:492</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="runAsync" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>run<wbr/>Async</span><a href="#runAsync" 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-protected tsd-is-inherited"><li class="tsd-signature tsd-anchor-link"><a id="runAsync.runAsync-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">run<wbr/>Async</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">fn</span>, <span class="tsd-kind-parameter">task</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#runAsync.runAsync-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>Runs the given task function asynchronously.</p>
73 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">fn</span>: <a href="../types/TaskAsyncFunction.html" class="tsd-signature-type tsd-kind-type-alias">TaskAsyncFunction</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Data-1">Data</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Response-1">Response</a><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>Task function that will be executed.</p>
74 </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">task</span>: <a href="../interfaces/Task.html" class="tsd-signature-type tsd-kind-interface">Task</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Data-1">Data</a><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>Input data for the task function.</p>
75 </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"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#runAsync">runAsync</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L556">src/worker/abstract-worker.ts:556</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="runSync" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>run<wbr/>Sync</span><a href="#runSync" 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-protected tsd-is-inherited"><li class="tsd-signature tsd-anchor-link"><a id="runSync.runSync-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">run<wbr/>Sync</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">fn</span>, <span class="tsd-kind-parameter">task</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#runSync.runSync-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>Runs the given task function synchronously.</p>
76 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">fn</span>: <a href="../types/TaskSyncFunction.html" class="tsd-signature-type tsd-kind-type-alias">TaskSyncFunction</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Data-1">Data</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Response-1">Response</a><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>Task function that will be executed.</p>
77 </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">task</span>: <a href="../interfaces/Task.html" class="tsd-signature-type tsd-kind-interface">Task</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Data-1">Data</a><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>Input data for the task function.</p>
78 </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"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#runSync">runSync</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L521">src/worker/abstract-worker.ts:521</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="sendTaskFunctionNamesToMainWorker" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>send<wbr/>Task<wbr/>Function<wbr/>Names<wbr/>To<wbr/>Main<wbr/>Worker</span><a href="#sendTaskFunctionNamesToMainWorker" 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-protected tsd-is-inherited"><li class="tsd-signature tsd-anchor-link"><a id="sendTaskFunctionNamesToMainWorker.sendTaskFunctionNamesToMainWorker-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">send<wbr/>Task<wbr/>Function<wbr/>Names<wbr/>To<wbr/>Main<wbr/>Worker</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="#sendTaskFunctionNamesToMainWorker.sendTaskFunctionNamesToMainWorker-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>Sends task function names to the main worker.</p>
79 </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"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#sendTaskFunctionNamesToMainWorker">sendTaskFunctionNamesToMainWorker</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L471">src/worker/abstract-worker.ts:471</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-protected"><a id="sendToMainWorker" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>send<wbr/>To<wbr/>Main<wbr/>Worker</span><a href="#sendToMainWorker" 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-protected"><li class="tsd-signature tsd-anchor-link"><a id="sendToMainWorker.sendToMainWorker-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">send<wbr/>To<wbr/>Main<wbr/>Worker</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">message</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#sendToMainWorker.sendToMainWorker-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>Sends a message to main worker.</p>
80 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">message</span>: <a href="../interfaces/MessageValue.html" class="tsd-signature-type tsd-kind-interface">MessageValue</a><span class="tsd-signature-symbol">&lt;</span><a class="tsd-signature-type tsd-kind-type-parameter" href="ThreadWorker.html#constructor.new_ThreadWorker.Response-1">Response</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">&gt;</span></span><div class="tsd-comment tsd-typography"><p>The response message.</p>
81 </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"><p>Overrides <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#sendToMainWorker">sendToMainWorker</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/thread-worker.ts#L85">src/worker/thread-worker.ts:85</a></li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited"><a id="setDefaultTaskFunction" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>set<wbr/>Default<wbr/>Task<wbr/>Function</span><a href="#setDefaultTaskFunction" 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-inherited"><li class="tsd-signature tsd-anchor-link"><a id="setDefaultTaskFunction.setDefaultTaskFunction-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">set<wbr/>Default<wbr/>Task<wbr/>Function</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/TaskFunctionOperationResult.html" class="tsd-signature-type tsd-kind-interface">TaskFunctionOperationResult</a><a href="#setDefaultTaskFunction.setDefaultTaskFunction-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 task function to use in the worker.</p>
82 </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">name</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The name of the task function to use as default task function.</p>
83 </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <a href="../interfaces/TaskFunctionOperationResult.html" class="tsd-signature-type tsd-kind-interface">TaskFunctionOperationResult</a></h4><p>Whether the default task function was set or not.</p>
84 <div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><p>Inherited from <a href="AbstractWorker.html">AbstractWorker</a>.<a href="AbstractWorker.html#setDefaultTaskFunction">setDefaultTaskFunction</a></p><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/01f4a5c/src/worker/abstract-worker.ts#L271">src/worker/abstract-worker.ts:271</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="#activeInterval" class="tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>active<wbr/>Interval</span></a><a href="#isMain" class="tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>is<wbr/>Main</span></a><a href="#lastTaskTimestamp" class="tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>last<wbr/>Task<wbr/>Timestamp</span></a><a href="#opts" class="tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>opts</span></a><a href="#port" class="tsd-is-private"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>port</span></a><a href="#statistics" class="tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>statistics</span></a><a href="#taskFunctions" class="tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>task<wbr/>Functions</span></a><a href="#id" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-262144"></use></svg><span>id</span></a><a href="#addTaskFunction" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Task<wbr/>Function</span></a><a href="#getMainWorker" class="tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Main<wbr/>Worker</span></a><a href="#handleError" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>handle<wbr/>Error</span></a><a href="#handleKillMessage" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>handle<wbr/>Kill<wbr/>Message</span></a><a href="#handleReadyMessage" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>handle<wbr/>Ready<wbr/>Message</span></a><a href="#handleTaskFunctionOperationMessage" class="tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>handle<wbr/>Task<wbr/>Function<wbr/>Operation<wbr/>Message</span></a><a href="#hasTaskFunction" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>has<wbr/>Task<wbr/>Function</span></a><a href="#listTaskFunctionNames" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>list<wbr/>Task<wbr/>Function<wbr/>Names</span></a><a href="#messageListener" class="tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>message<wbr/>Listener</span></a><a href="#removeTaskFunction" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Task<wbr/>Function</span></a><a href="#run" class="tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>run</span></a><a href="#runAsync" class="tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>run<wbr/>Async</span></a><a href="#runSync" class="tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>run<wbr/>Sync</span></a><a href="#sendTaskFunctionNamesToMainWorker" class="tsd-is-protected tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>send<wbr/>Task<wbr/>Function<wbr/>Names<wbr/>To<wbr/>Main<wbr/>Worker</span></a><a href="#sendToMainWorker" class="tsd-is-protected"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>send<wbr/>To<wbr/>Main<wbr/>Worker</span></a><a href="#setDefaultTaskFunction" class="tsd-is-inherited"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Default<wbr/>Task<wbr/>Function</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 - v3.1.22</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><div class="tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div></body></html>