Version 2.2.0
[poolifier.git] / docs / classes / dynamicthreadpool.html
CommitLineData
5ea22628
JB
1<!doctype html>
2<html class="default no-js">
3<head>
4 <meta charset="utf-8">
5 <meta http-equiv="X-UA-Compatible" content="IE=edge">
6 <title>DynamicThreadPool | poolifier</title>
7 <meta name="description" content="Documentation for poolifier">
8 <meta name="viewport" content="width=device-width, initial-scale=1">
9 <link rel="stylesheet" href="../assets/css/main.css">
10 <script async src="../assets/js/search.js" id="search-script"></script>
11</head>
12<body>
13<header>
14 <div class="tsd-page-toolbar">
15 <div class="container">
16 <div class="table-wrap">
17 <div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
18 <div class="field">
19 <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
20 <input id="tsd-search-field" type="text" />
21 </div>
22 <ul class="results">
23 <li class="state loading">Preparing search index...</li>
24 <li class="state failure">The search index is not available</li>
25 </ul>
26 <a href="../index.html" class="title">poolifier</a>
27 </div>
28 <div class="table-cell" id="tsd-widgets">
29 <div id="tsd-filter">
30 <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
31 <div class="tsd-filter-group">
32 <div class="tsd-select" id="tsd-filter-visibility">
33 <span class="tsd-select-label">All</span>
34 <ul class="tsd-select-list">
35 <li data-value="public">Public</li>
36 <li data-value="protected">Public/Protected</li>
37 <li data-value="private" class="selected">All</li>
38 </ul>
39 </div>
40 <input type="checkbox" id="tsd-filter-inherited" checked />
41 <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
42 <input type="checkbox" id="tsd-filter-externals" checked />
43 <label class="tsd-widget" for="tsd-filter-externals">Externals</label>
44 </div>
45 </div>
46 <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
47 </div>
48 </div>
49 </div>
50 </div>
51 <div class="tsd-page-title">
52 <div class="container">
53 <ul class="tsd-breadcrumb">
54 <li>
55 <a href="../index.html">poolifier</a>
56 </li>
57 <li>
58 <a href="dynamicthreadpool.html">DynamicThreadPool</a>
59 </li>
60 </ul>
61 <h1>Class DynamicThreadPool&lt;Data, Response&gt;</h1>
62 </div>
63 </div>
64</header>
65<div class="container container-main">
66 <div class="row">
67 <div class="col-8 col-content">
68 <section class="tsd-panel tsd-comment">
69 <div class="tsd-comment tsd-typography">
70 <div class="lead">
71 <p>A thread pool with a dynamic number of threads, but a guaranteed minimum number of threads.</p>
72 </div>
73 <p>This thread pool creates new threads when the others are busy, up to the maximum number of threads.
74 When the maximum number of threads is reached, an event is emitted. If you want to listen to this event, use the pool&#39;s <code>emitter</code>.</p>
75 <dl class="tsd-comment-tags">
76 <dt>author</dt>
77 <dd><p><a href="https://github.com/pioardi">Alessandro Pio Ardizio</a></p>
78 </dd>
79 <dt>since</dt>
80 <dd><p>0.0.1</p>
81 </dd>
82 </dl>
83 </div>
84 </section>
85 <section class="tsd-panel tsd-type-parameters">
86 <h3>Type parameters</h3>
87 <ul class="tsd-type-parameters">
88 <li>
89 <h4>Data = <span class="tsd-signature-type">unknown</span></h4>
90 <div class="tsd-comment tsd-typography">
91 <div class="lead">
92 <p>Type of data sent to the worker. This can only be serializable data.</p>
93 </div>
94 </div>
95 </li>
96 <li>
97 <h4>Response = <span class="tsd-signature-type">unknown</span></h4>
98 <div class="tsd-comment tsd-typography">
99 <div class="lead">
100 <p>Type of response of execution. This can only be serializable data.</p>
101 </div>
102 </div>
103 </li>
104 </ul>
105 </section>
106 <section class="tsd-panel tsd-hierarchy">
107 <h3>Hierarchy</h3>
108 <ul class="tsd-hierarchy">
109 <li>
110 <a href="fixedthreadpool.html" class="tsd-signature-type" data-tsd-kind="Class">FixedThreadPool</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Data</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Response</span><span class="tsd-signature-symbol">&gt;</span>
111 <ul class="tsd-hierarchy">
112 <li>
113 <span class="target">DynamicThreadPool</span>
114 </li>
115 </ul>
116 </li>
117 </ul>
118 </section>
119 <section class="tsd-panel-group tsd-index-group">
120 <h2>Index</h2>
121 <section class="tsd-panel tsd-index-panel">
122 <div class="tsd-index-content">
123 <section class="tsd-index-section ">
124 <h3>Constructors</h3>
125 <ul class="tsd-index-list">
126 <li class="tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="dynamicthreadpool.html#constructor" class="tsd-kind-icon">constructor</a></li>
127 </ul>
128 </section>
129 <section class="tsd-index-section ">
130 <h3>Properties</h3>
131 <ul class="tsd-index-list">
132 <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="dynamicthreadpool.html#emitter" class="tsd-kind-icon">emitter</a></li>
133 <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="dynamicthreadpool.html#filepath" class="tsd-kind-icon">file<wbr>Path</a></li>
7c0ba920 134 <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="dynamicthreadpool.html#max" class="tsd-kind-icon">max</a></li>
5ea22628
JB
135 <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="dynamicthreadpool.html#nextmessageid" class="tsd-kind-icon">next<wbr>Message<wbr>Id</a></li>
136 <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="dynamicthreadpool.html#numberofworkers" class="tsd-kind-icon">number<wbr>OfWorkers</a></li>
137 <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="dynamicthreadpool.html#opts" class="tsd-kind-icon">opts</a></li>
138 <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="dynamicthreadpool.html#promisemap" class="tsd-kind-icon">promise<wbr>Map</a></li>
139 <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="dynamicthreadpool.html#tasks" class="tsd-kind-icon">tasks</a></li>
140 <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="dynamicthreadpool.html#workerchoicestrategycontext" class="tsd-kind-icon">worker<wbr>Choice<wbr>Strategy<wbr>Context</a></li>
141 <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><a href="dynamicthreadpool.html#workers" class="tsd-kind-icon">workers</a></li>
142 </ul>
143 </section>
144 <section class="tsd-index-section ">
145 <h3>Accessors</h3>
146 <ul class="tsd-index-list">
7c0ba920
JB
147 <li class="tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited"><a href="dynamicthreadpool.html#busy" class="tsd-kind-icon">busy</a></li>
148 <li class="tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited"><a href="dynamicthreadpool.html#numberofrunningtasks" class="tsd-kind-icon">number<wbr>OfRunning<wbr>Tasks</a></li>
149 <li class="tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited"><a href="dynamicthreadpool.html#type" class="tsd-kind-icon">type</a></li>
5ea22628
JB
150 </ul>
151 </section>
152 <section class="tsd-index-section ">
153 <h3>Methods</h3>
154 <ul class="tsd-index-list">
155 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="dynamicthreadpool.html#afterworkersetup" class="tsd-kind-icon">after<wbr>Worker<wbr>Setup</a></li>
156 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="dynamicthreadpool.html#chooseworker" class="tsd-kind-icon">choose<wbr>Worker</a></li>
157 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="dynamicthreadpool.html#createandsetupworker" class="tsd-kind-icon">create<wbr>And<wbr>Setup<wbr>Worker</a></li>
158 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="dynamicthreadpool.html#createworker" class="tsd-kind-icon">create<wbr>Worker</a></li>
159 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="dynamicthreadpool.html#decreaseworkerstasks" class="tsd-kind-icon">decrease<wbr>Workers<wbr>Tasks</a></li>
160 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="dynamicthreadpool.html#destroy" class="tsd-kind-icon">destroy</a></li>
161 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="dynamicthreadpool.html#destroyworker" class="tsd-kind-icon">destroy<wbr>Worker</a></li>
162 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="dynamicthreadpool.html#execute" class="tsd-kind-icon">execute</a></li>
7c0ba920 163 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="dynamicthreadpool.html#findfreetasksmapentry" class="tsd-kind-icon">find<wbr>Free<wbr>Tasks<wbr>Map<wbr>Entry</a></li>
5ea22628
JB
164 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="dynamicthreadpool.html#increaseworkerstask" class="tsd-kind-icon">increase<wbr>Workers<wbr>Task</a></li>
165 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="dynamicthreadpool.html#internalexecute" class="tsd-kind-icon">internal<wbr>Execute</a></li>
7c0ba920 166 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="dynamicthreadpool.html#internalgetbusystatus" class="tsd-kind-icon">internal<wbr>Get<wbr>Busy<wbr>Status</a></li>
5ea22628
JB
167 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="dynamicthreadpool.html#ismain" class="tsd-kind-icon">is<wbr>Main</a></li>
168 <li class="tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited"><a href="dynamicthreadpool.html#registerworkermessagelistener" class="tsd-kind-icon">register<wbr>Worker<wbr>Message<wbr>Listener</a></li>
169 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="dynamicthreadpool.html#removeworker" class="tsd-kind-icon">remove<wbr>Worker</a></li>
170 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="dynamicthreadpool.html#sendtoworker" class="tsd-kind-icon">send<wbr>ToWorker</a></li>
171 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><a href="dynamicthreadpool.html#setworkerchoicestrategy" class="tsd-kind-icon">set<wbr>Worker<wbr>Choice<wbr>Strategy</a></li>
172 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="dynamicthreadpool.html#setuphook" class="tsd-kind-icon">setup<wbr>Hook</a></li>
173 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected"><a href="dynamicthreadpool.html#workerlistener" class="tsd-kind-icon">worker<wbr>Listener</a></li>
174 </ul>
175 </section>
176 </div>
177 </section>
178 </section>
179 <section class="tsd-panel-group tsd-member-group ">
180 <h2>Constructors</h2>
181 <section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited">
182 <a name="constructor" class="tsd-anchor"></a>
183 <h3>constructor</h3>
184 <ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited">
185 <li class="tsd-signature tsd-kind-icon">new <wbr>Dynamic<wbr>Thread<wbr>Pool&lt;Data, Response&gt;<span class="tsd-signature-symbol">(</span>min<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, max<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, filePath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, opts<span class="tsd-signature-symbol">?: </span><a href="../interfaces/pooloptions.html" class="tsd-signature-type" data-tsd-kind="Interface">PoolOptions</a><span class="tsd-signature-symbol">&lt;</span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="dynamicthreadpool.html" class="tsd-signature-type" data-tsd-kind="Class">DynamicThreadPool</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Data</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Response</span><span class="tsd-signature-symbol">&gt;</span></li>
186 </ul>
187 <ul class="tsd-descriptions">
188 <li class="tsd-description">
189 <aside class="tsd-sources">
190 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#constructor">constructor</a></p>
191 <ul>
849e0547 192 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/thread/dynamic.ts#L21">src/pools/thread/dynamic.ts:21</a></li>
5ea22628
JB
193 </ul>
194 </aside>
195 <div class="tsd-comment tsd-typography">
196 <div class="lead">
197 <p>Constructs a new poolifier dynamic thread pool.</p>
198 </div>
199 </div>
200 <h4 class="tsd-type-parameters-title">Type parameters</h4>
201 <ul class="tsd-type-parameters">
202 <li>
203 <h4>Data = <span class="tsd-signature-type">unknown</span></h4>
204 </li>
205 <li>
206 <h4>Response = <span class="tsd-signature-type">unknown</span></h4>
207 </li>
208 </ul>
209 <h4 class="tsd-parameters-title">Parameters</h4>
210 <ul class="tsd-parameters">
211 <li>
212 <h5>min: <span class="tsd-signature-type">number</span></h5>
213 <div class="tsd-comment tsd-typography">
214 <p>Minimum number of threads which are always active.</p>
215 </div>
216 </li>
217 <li>
218 <h5>max: <span class="tsd-signature-type">number</span></h5>
219 <div class="tsd-comment tsd-typography">
220 <p>Maximum number of threads that can be created by this pool.</p>
221 </div>
222 </li>
223 <li>
224 <h5>filePath: <span class="tsd-signature-type">string</span></h5>
225 <div class="tsd-comment tsd-typography">
226 <p>Path to an implementation of a <code>ThreadWorker</code> file, which can be relative or absolute.</p>
227 </div>
228 </li>
229 <li>
230 <h5>opts: <a href="../interfaces/pooloptions.html" class="tsd-signature-type" data-tsd-kind="Interface">PoolOptions</a><span class="tsd-signature-symbol">&lt;</span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> = ...</span></h5>
231 <div class="tsd-comment tsd-typography">
232 <p>Options for this dynamic thread pool. Default: <code>{}</code></p>
233 </div>
234 </li>
235 </ul>
236 <h4 class="tsd-returns-title">Returns <a href="dynamicthreadpool.html" class="tsd-signature-type" data-tsd-kind="Class">DynamicThreadPool</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Data</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Response</span><span class="tsd-signature-symbol">&gt;</span></h4>
237 </li>
238 </ul>
239 </section>
240 </section>
241 <section class="tsd-panel-group tsd-member-group ">
242 <h2>Properties</h2>
243 <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
244 <a name="emitter" class="tsd-anchor"></a>
7c0ba920
JB
245 <h3><span class="tsd-flag ts-flagOptional">Optional</span> <span class="tsd-flag ts-flagReadonly">Readonly</span> emitter</h3>
246 <div class="tsd-signature tsd-kind-icon">emitter<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">PoolEmitter</span></div>
5ea22628
JB
247 <aside class="tsd-sources">
248 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#emitter">emitter</a></p>
249 <ul>
849e0547 250 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L117">src/pools/abstract-pool.ts:117</a></li>
5ea22628
JB
251 </ul>
252 </aside>
253 </section>
254 <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
255 <a name="filepath" class="tsd-anchor"></a>
256 <h3><span class="tsd-flag ts-flagReadonly">Readonly</span> file<wbr>Path</h3>
257 <div class="tsd-signature tsd-kind-icon">file<wbr>Path<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
258 <aside class="tsd-sources">
259 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#filepath">filePath</a></p>
260 </aside>
261 </section>
7c0ba920 262 <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
5ea22628
JB
263 <a name="max" class="tsd-anchor"></a>
264 <h3><span class="tsd-flag ts-flagReadonly">Readonly</span> max</h3>
265 <div class="tsd-signature tsd-kind-icon">max<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
266 <aside class="tsd-sources">
7c0ba920 267 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#max">max</a></p>
5ea22628
JB
268 </aside>
269 </section>
270 <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
271 <a name="nextmessageid" class="tsd-anchor"></a>
272 <h3><span class="tsd-flag ts-flagProtected">Protected</span> next<wbr>Message<wbr>Id</h3>
273 <div class="tsd-signature tsd-kind-icon">next<wbr>Message<wbr>Id<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 0</span></div>
274 <aside class="tsd-sources">
275 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#nextmessageid">nextMessageId</a></p>
276 <ul>
849e0547 277 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L138">src/pools/abstract-pool.ts:138</a></li>
5ea22628
JB
278 </ul>
279 </aside>
280 <div class="tsd-comment tsd-typography">
281 <div class="lead">
282 <p>ID of the next message.</p>
283 </div>
284 </div>
285 </section>
286 <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
287 <a name="numberofworkers" class="tsd-anchor"></a>
288 <h3><span class="tsd-flag ts-flagReadonly">Readonly</span> number<wbr>OfWorkers</h3>
289 <div class="tsd-signature tsd-kind-icon">number<wbr>OfWorkers<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
290 <aside class="tsd-sources">
291 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#numberofworkers">numberOfWorkers</a></p>
292 </aside>
293 </section>
294 <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
295 <a name="opts" class="tsd-anchor"></a>
296 <h3><span class="tsd-flag ts-flagReadonly">Readonly</span> opts</h3>
297 <div class="tsd-signature tsd-kind-icon">opts<span class="tsd-signature-symbol">:</span> <a href="../interfaces/pooloptions.html" class="tsd-signature-type" data-tsd-kind="Interface">PoolOptions</a><span class="tsd-signature-symbol">&lt;</span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a><span class="tsd-signature-symbol">&gt;</span></div>
298 <aside class="tsd-sources">
299 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#opts">opts</a></p>
300 </aside>
301 </section>
302 <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
303 <a name="promisemap" class="tsd-anchor"></a>
304 <h3><span class="tsd-flag ts-flagProtected">Protected</span> promise<wbr>Map</h3>
305 <div class="tsd-signature tsd-kind-icon">promise<wbr>Map<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">number</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">PromiseWorkerResponseWrapper</span><span class="tsd-signature-symbol">&lt;</span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Response</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> = ...</span></div>
306 <aside class="tsd-sources">
307 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#promisemap">promiseMap</a></p>
308 <ul>
849e0547 309 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L130">src/pools/abstract-pool.ts:130</a></li>
5ea22628
JB
310 </ul>
311 </aside>
312 <div class="tsd-comment tsd-typography">
313 <div class="lead">
314 <p>The promise map.</p>
315 </div>
316 <ul>
317 <li><code>key</code>: This is the message ID of each submitted task.</li>
318 <li><code>value</code>: An object that contains the worker, the resolve function and the reject function.</li>
319 </ul>
320 <p>When we receive a message from the worker we get a map entry and resolve/reject the promise based on the message.</p>
321 </div>
322 </section>
323 <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
324 <a name="tasks" class="tsd-anchor"></a>
325 <h3><span class="tsd-flag ts-flagReadonly">Readonly</span> tasks</h3>
326 <div class="tsd-signature tsd-kind-icon">tasks<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol">&lt;</span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol"> = ...</span></div>
327 <aside class="tsd-sources">
328 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#tasks">tasks</a></p>
329 <ul>
849e0547 330 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L114">src/pools/abstract-pool.ts:114</a></li>
5ea22628
JB
331 </ul>
332 </aside>
333 </section>
334 <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
335 <a name="workerchoicestrategycontext" class="tsd-anchor"></a>
336 <h3><span class="tsd-flag ts-flagProtected">Protected</span> worker<wbr>Choice<wbr>Strategy<wbr>Context</h3>
337 <div class="tsd-signature tsd-kind-icon">worker<wbr>Choice<wbr>Strategy<wbr>Context<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">WorkerChoiceStrategyContext</span><span class="tsd-signature-symbol">&lt;</span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Data</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">Response</span><span class="tsd-signature-symbol">&gt;</span></div>
338 <aside class="tsd-sources">
339 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#workerchoicestrategycontext">workerChoiceStrategyContext</a></p>
340 <ul>
849e0547 341 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L145">src/pools/abstract-pool.ts:145</a></li>
5ea22628
JB
342 </ul>
343 </aside>
344 <div class="tsd-comment tsd-typography">
345 <div class="lead">
346 <p>Worker choice strategy instance implementing the worker choice algorithm.</p>
347 </div>
348 <p>Default to a strategy implementing a round robin algorithm.</p>
349 </div>
350 </section>
351 <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
352 <a name="workers" class="tsd-anchor"></a>
353 <h3><span class="tsd-flag ts-flagReadonly">Readonly</span> workers</h3>
354 <div class="tsd-signature tsd-kind-icon">workers<span class="tsd-signature-symbol">:</span> <a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = ...</span></div>
355 <aside class="tsd-sources">
356 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#workers">workers</a></p>
357 <ul>
849e0547 358 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L111">src/pools/abstract-pool.ts:111</a></li>
5ea22628
JB
359 </ul>
360 </aside>
361 </section>
362 </section>
363 <section class="tsd-panel-group tsd-member-group ">
364 <h2>Accessors</h2>
365 <section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited">
7c0ba920
JB
366 <a name="busy" class="tsd-anchor"></a>
367 <h3>busy</h3>
5ea22628 368 <ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited">
7c0ba920 369 <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> busy<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
5ea22628
JB
370 </ul>
371 <ul class="tsd-descriptions">
372 <li class="tsd-description">
373 <aside class="tsd-sources">
374 <ul>
849e0547 375 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/thread/dynamic.ts#L45">src/pools/thread/dynamic.ts:45</a></li>
5ea22628
JB
376 </ul>
377 </aside>
378 <div class="tsd-comment tsd-typography">
379 <dl class="tsd-comment-tags">
380 <dt>inheritdoc</dt>
381 <dd></dd>
382 </dl>
383 </div>
384 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
385 </li>
386 </ul>
387 </section>
7c0ba920
JB
388 <section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited">
389 <a name="numberofrunningtasks" class="tsd-anchor"></a>
390 <h3>number<wbr>OfRunning<wbr>Tasks</h3>
391 <ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited">
392 <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> numberOfRunningTasks<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>
393 </ul>
394 <ul class="tsd-descriptions">
395 <li class="tsd-description">
396 <aside class="tsd-sources">
397 <ul>
849e0547 398 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L232">src/pools/abstract-pool.ts:232</a></li>
7c0ba920
JB
399 </ul>
400 </aside>
401 <div class="tsd-comment tsd-typography">
402 <dl class="tsd-comment-tags">
403 <dt>inheritdoc</dt>
404 <dd></dd>
405 </dl>
406 </div>
407 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
408 </li>
409 </ul>
410 </section>
411 <section class="tsd-panel tsd-member tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited">
412 <a name="type" class="tsd-anchor"></a>
413 <h3>type</h3>
414 <ul class="tsd-signatures tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited">
415 <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">get</span> type<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">PoolType</span></li>
416 </ul>
417 <ul class="tsd-descriptions">
418 <li class="tsd-description">
419 <aside class="tsd-sources">
420 <ul>
849e0547 421 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/thread/dynamic.ts#L40">src/pools/thread/dynamic.ts:40</a></li>
7c0ba920
JB
422 </ul>
423 </aside>
424 <div class="tsd-comment tsd-typography">
425 <dl class="tsd-comment-tags">
426 <dt>inheritdoc</dt>
427 <dd></dd>
428 </dl>
429 </div>
430 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">PoolType</span></h4>
431 </li>
432 </ul>
433 </section>
5ea22628
JB
434 </section>
435 <section class="tsd-panel-group tsd-member-group ">
436 <h2>Methods</h2>
437 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
438 <a name="afterworkersetup" class="tsd-anchor"></a>
439 <h3><span class="tsd-flag ts-flagProtected">Protected</span> after<wbr>Worker<wbr>Setup</h3>
440 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
441 <li class="tsd-signature tsd-kind-icon">after<wbr>Worker<wbr>Setup<span class="tsd-signature-symbol">(</span>worker<span class="tsd-signature-symbol">: </span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
442 </ul>
443 <ul class="tsd-descriptions">
444 <li class="tsd-description">
445 <aside class="tsd-sources">
446 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#afterworkersetup">afterWorkerSetup</a></p>
447 <ul>
849e0547 448 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/thread/fixed.ts#L77">src/pools/thread/fixed.ts:77</a></li>
5ea22628
JB
449 </ul>
450 </aside>
451 <h4 class="tsd-parameters-title">Parameters</h4>
452 <ul class="tsd-parameters">
453 <li>
454 <h5>worker: <a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a></h5>
455 </li>
456 </ul>
457 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
458 </li>
459 </ul>
460 </section>
461 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
462 <a name="chooseworker" class="tsd-anchor"></a>
463 <h3><span class="tsd-flag ts-flagProtected">Protected</span> choose<wbr>Worker</h3>
464 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
465 <li class="tsd-signature tsd-kind-icon">choose<wbr>Worker<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a></li>
466 </ul>
467 <ul class="tsd-descriptions">
468 <li class="tsd-description">
469 <aside class="tsd-sources">
470 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#chooseworker">chooseWorker</a></p>
471 <ul>
849e0547 472 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L356">src/pools/abstract-pool.ts:356</a></li>
5ea22628
JB
473 </ul>
474 </aside>
475 <div class="tsd-comment tsd-typography">
476 <div class="lead">
477 <p>Choose a worker for the next task.</p>
478 </div>
479 <p>The default implementation uses a round robin algorithm to distribute the load.</p>
480 </div>
481 <h4 class="tsd-returns-title">Returns <a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a></h4>
482 <p>Worker.</p>
483 </li>
484 </ul>
485 </section>
486 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
487 <a name="createandsetupworker" class="tsd-anchor"></a>
488 <h3><span class="tsd-flag ts-flagProtected">Protected</span> create<wbr>And<wbr>Setup<wbr>Worker</h3>
489 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
490 <li class="tsd-signature tsd-kind-icon">create<wbr>And<wbr>Setup<wbr>Worker<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a></li>
491 </ul>
492 <ul class="tsd-descriptions">
493 <li class="tsd-description">
494 <aside class="tsd-sources">
495 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#createandsetupworker">createAndSetupWorker</a></p>
496 <ul>
849e0547 497 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L409">src/pools/abstract-pool.ts:409</a></li>
5ea22628
JB
498 </ul>
499 </aside>
500 <div class="tsd-comment tsd-typography">
501 <div class="lead">
502 <p>Creates a new worker for this pool and sets it up completely.</p>
503 </div>
504 </div>
505 <h4 class="tsd-returns-title">Returns <a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a></h4>
506 <p>New, completely set up worker.</p>
507 </li>
508 </ul>
509 </section>
510 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
511 <a name="createworker" class="tsd-anchor"></a>
512 <h3><span class="tsd-flag ts-flagProtected">Protected</span> create<wbr>Worker</h3>
513 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
514 <li class="tsd-signature tsd-kind-icon">create<wbr>Worker<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a></li>
515 </ul>
516 <ul class="tsd-descriptions">
517 <li class="tsd-description">
518 <aside class="tsd-sources">
519 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#createworker">createWorker</a></p>
520 <ul>
849e0547 521 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/thread/fixed.ts#L71">src/pools/thread/fixed.ts:71</a></li>
5ea22628
JB
522 </ul>
523 </aside>
524 <h4 class="tsd-returns-title">Returns <a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a></h4>
525 </li>
526 </ul>
527 </section>
528 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
529 <a name="decreaseworkerstasks" class="tsd-anchor"></a>
530 <h3><span class="tsd-flag ts-flagProtected">Protected</span> decrease<wbr>Workers<wbr>Tasks</h3>
531 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
532 <li class="tsd-signature tsd-kind-icon">decrease<wbr>Workers<wbr>Tasks<span class="tsd-signature-symbol">(</span>worker<span class="tsd-signature-symbol">: </span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
533 </ul>
534 <ul class="tsd-descriptions">
535 <li class="tsd-description">
536 <aside class="tsd-sources">
537 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#decreaseworkerstasks">decreaseWorkersTasks</a></p>
538 <ul>
849e0547 539 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L318">src/pools/abstract-pool.ts:318</a></li>
5ea22628
JB
540 </ul>
541 </aside>
542 <div class="tsd-comment tsd-typography">
543 <div class="lead">
7c0ba920 544 <p>Decrease the number of tasks that the given workers has applied.</p>
5ea22628
JB
545 </div>
546 </div>
547 <h4 class="tsd-parameters-title">Parameters</h4>
548 <ul class="tsd-parameters">
549 <li>
550 <h5>worker: <a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a></h5>
551 <div class="tsd-comment tsd-typography">
552 <p>Worker whose tasks are decreased.</p>
553 </div>
554 </li>
555 </ul>
556 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
557 </li>
558 </ul>
559 </section>
560 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
561 <a name="destroy" class="tsd-anchor"></a>
562 <h3>destroy</h3>
563 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
564 <li class="tsd-signature tsd-kind-icon">destroy<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></li>
565 </ul>
566 <ul class="tsd-descriptions">
567 <li class="tsd-description">
568 <aside class="tsd-sources">
569 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#destroy">destroy</a></p>
570 <ul>
849e0547 571 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L280">src/pools/abstract-pool.ts:280</a></li>
5ea22628
JB
572 </ul>
573 </aside>
574 <div class="tsd-comment tsd-typography">
575 <dl class="tsd-comment-tags">
576 <dt>inheritdoc</dt>
577 <dd></dd>
578 </dl>
579 </div>
580 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4>
581 </li>
582 </ul>
583 </section>
584 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
585 <a name="destroyworker" class="tsd-anchor"></a>
586 <h3>destroy<wbr>Worker</h3>
587 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
588 <li class="tsd-signature tsd-kind-icon">destroy<wbr>Worker<span class="tsd-signature-symbol">(</span>worker<span class="tsd-signature-symbol">: </span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></li>
589 </ul>
590 <ul class="tsd-descriptions">
591 <li class="tsd-description">
592 <aside class="tsd-sources">
593 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#destroyworker">destroyWorker</a></p>
594 <ul>
849e0547 595 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/thread/fixed.ts#L49">src/pools/thread/fixed.ts:49</a></li>
5ea22628
JB
596 </ul>
597 </aside>
598 <div class="tsd-comment tsd-typography">
599 <dl class="tsd-comment-tags">
600 <dt>inheritdoc</dt>
601 <dd></dd>
602 </dl>
603 </div>
604 <h4 class="tsd-parameters-title">Parameters</h4>
605 <ul class="tsd-parameters">
606 <li>
607 <h5>worker: <a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a></h5>
608 </li>
609 </ul>
610 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4>
611 </li>
612 </ul>
613 </section>
614 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
615 <a name="execute" class="tsd-anchor"></a>
616 <h3>execute</h3>
617 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
618 <li class="tsd-signature tsd-kind-icon">execute<span class="tsd-signature-symbol">(</span>data<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Data</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Response</span><span class="tsd-signature-symbol">&gt;</span></li>
619 </ul>
620 <ul class="tsd-descriptions">
621 <li class="tsd-description">
622 <aside class="tsd-sources">
623 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#execute">execute</a></p>
624 <ul>
849e0547 625 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L268">src/pools/abstract-pool.ts:268</a></li>
5ea22628
JB
626 </ul>
627 </aside>
628 <div class="tsd-comment tsd-typography">
629 <dl class="tsd-comment-tags">
630 <dt>inheritdoc</dt>
631 <dd></dd>
632 </dl>
633 </div>
634 <h4 class="tsd-parameters-title">Parameters</h4>
635 <ul class="tsd-parameters">
636 <li>
637 <h5>data: <span class="tsd-signature-type">Data</span></h5>
638 </li>
639 </ul>
640 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Response</span><span class="tsd-signature-symbol">&gt;</span></h4>
641 </li>
642 </ul>
643 </section>
7c0ba920
JB
644 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
645 <a name="findfreetasksmapentry" class="tsd-anchor"></a>
646 <h3>find<wbr>Free<wbr>Tasks<wbr>Map<wbr>Entry</h3>
647 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
648 <li class="tsd-signature tsd-kind-icon">find<wbr>Free<wbr>Tasks<wbr>Map<wbr>Entry<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">false</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">[</span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span></li>
649 </ul>
650 <ul class="tsd-descriptions">
651 <li class="tsd-description">
652 <aside class="tsd-sources">
653 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#findfreetasksmapentry">findFreeTasksMapEntry</a></p>
654 <ul>
849e0547 655 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L257">src/pools/abstract-pool.ts:257</a></li>
7c0ba920
JB
656 </ul>
657 </aside>
658 <div class="tsd-comment tsd-typography">
659 <dl class="tsd-comment-tags">
660 <dt>inheritdoc</dt>
661 <dd></dd>
662 </dl>
663 </div>
664 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">false</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-symbol">[</span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">]</span></h4>
665 </li>
666 </ul>
667 </section>
5ea22628
JB
668 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
669 <a name="increaseworkerstask" class="tsd-anchor"></a>
670 <h3><span class="tsd-flag ts-flagProtected">Protected</span> increase<wbr>Workers<wbr>Task</h3>
671 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
672 <li class="tsd-signature tsd-kind-icon">increase<wbr>Workers<wbr>Task<span class="tsd-signature-symbol">(</span>worker<span class="tsd-signature-symbol">: </span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
673 </ul>
674 <ul class="tsd-descriptions">
675 <li class="tsd-description">
676 <aside class="tsd-sources">
677 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#increaseworkerstask">increaseWorkersTask</a></p>
678 <ul>
849e0547 679 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L309">src/pools/abstract-pool.ts:309</a></li>
5ea22628
JB
680 </ul>
681 </aside>
682 <div class="tsd-comment tsd-typography">
683 <div class="lead">
7c0ba920 684 <p>Increase the number of tasks that the given workers has applied.</p>
5ea22628
JB
685 </div>
686 </div>
687 <h4 class="tsd-parameters-title">Parameters</h4>
688 <ul class="tsd-parameters">
689 <li>
690 <h5>worker: <a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a></h5>
691 <div class="tsd-comment tsd-typography">
692 <p>Worker whose tasks are increased.</p>
693 </div>
694 </li>
695 </ul>
696 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
697 </li>
698 </ul>
699 </section>
700 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
701 <a name="internalexecute" class="tsd-anchor"></a>
702 <h3><span class="tsd-flag ts-flagProtected">Protected</span> internal<wbr>Execute</h3>
703 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
704 <li class="tsd-signature tsd-kind-icon">internal<wbr>Execute<span class="tsd-signature-symbol">(</span>worker<span class="tsd-signature-symbol">: </span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a>, messageId<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Response</span><span class="tsd-signature-symbol">&gt;</span></li>
705 </ul>
706 <ul class="tsd-descriptions">
707 <li class="tsd-description">
708 <aside class="tsd-sources">
709 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#internalexecute">internalExecute</a></p>
710 <ul>
849e0547 711 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L381">src/pools/abstract-pool.ts:381</a></li>
5ea22628
JB
712 </ul>
713 </aside>
714 <h4 class="tsd-parameters-title">Parameters</h4>
715 <ul class="tsd-parameters">
716 <li>
717 <h5>worker: <a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a></h5>
718 </li>
719 <li>
720 <h5>messageId: <span class="tsd-signature-type">number</span></h5>
721 </li>
722 </ul>
723 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Response</span><span class="tsd-signature-symbol">&gt;</span></h4>
724 </li>
725 </ul>
726 </section>
7c0ba920
JB
727 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
728 <a name="internalgetbusystatus" class="tsd-anchor"></a>
729 <h3><span class="tsd-flag ts-flagProtected">Protected</span> internal<wbr>Get<wbr>Busy<wbr>Status</h3>
730 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
731 <li class="tsd-signature tsd-kind-icon">internal<wbr>Get<wbr>Busy<wbr>Status<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
732 </ul>
733 <ul class="tsd-descriptions">
734 <li class="tsd-description">
735 <aside class="tsd-sources">
736 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#internalgetbusystatus">internalGetBusyStatus</a></p>
737 <ul>
849e0547 738 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L249">src/pools/abstract-pool.ts:249</a></li>
7c0ba920
JB
739 </ul>
740 </aside>
741 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
742 </li>
743 </ul>
744 </section>
5ea22628
JB
745 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
746 <a name="ismain" class="tsd-anchor"></a>
747 <h3><span class="tsd-flag ts-flagProtected">Protected</span> is<wbr>Main</h3>
748 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
749 <li class="tsd-signature tsd-kind-icon">is<wbr>Main<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
750 </ul>
751 <ul class="tsd-descriptions">
752 <li class="tsd-description">
753 <aside class="tsd-sources">
754 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#ismain">isMain</a></p>
755 <ul>
849e0547 756 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/thread/fixed.ts#L44">src/pools/thread/fixed.ts:44</a></li>
5ea22628
JB
757 </ul>
758 </aside>
759 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
760 </li>
761 </ul>
762 </section>
763 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited">
764 <a name="registerworkermessagelistener" class="tsd-anchor"></a>
765 <h3>register<wbr>Worker<wbr>Message<wbr>Listener</h3>
766 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited">
767 <li class="tsd-signature tsd-kind-icon">register<wbr>Worker<wbr>Message<wbr>Listener&lt;Message&gt;<span class="tsd-signature-symbol">(</span>messageChannel<span class="tsd-signature-symbol">: </span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a>, listener<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">MessageValue</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Message</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
768 </ul>
769 <ul class="tsd-descriptions">
770 <li class="tsd-description">
771 <aside class="tsd-sources">
772 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#registerworkermessagelistener">registerWorkerMessageListener</a></p>
773 <ul>
849e0547 774 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/thread/fixed.ts#L64">src/pools/thread/fixed.ts:64</a></li>
5ea22628
JB
775 </ul>
776 </aside>
777 <div class="tsd-comment tsd-typography">
778 <dl class="tsd-comment-tags">
779 <dt>inheritdoc</dt>
780 <dd></dd>
781 </dl>
782 </div>
783 <h4 class="tsd-type-parameters-title">Type parameters</h4>
784 <ul class="tsd-type-parameters">
785 <li>
786 <h4>Message</h4>
787 </li>
788 </ul>
789 <h4 class="tsd-parameters-title">Parameters</h4>
790 <ul class="tsd-parameters">
791 <li>
792 <h5>messageChannel: <a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a></h5>
793 </li>
794 <li>
795 <h5>listener: <span class="tsd-signature-symbol">(</span>message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">MessageValue</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Message</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></h5>
796 <ul class="tsd-parameters">
797 <li class="tsd-parameter-signature">
798 <ul class="tsd-signatures tsd-kind-type-literal">
799 <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">MessageValue</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Message</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
800 </ul>
801 <ul class="tsd-descriptions">
802 <li class="tsd-description">
803 <h4 class="tsd-parameters-title">Parameters</h4>
804 <ul class="tsd-parameters">
805 <li>
806 <h5>message: <span class="tsd-signature-type">MessageValue</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Message</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">&gt;</span></h5>
807 </li>
808 </ul>
809 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
810 </li>
811 </ul>
812 </li>
813 </ul>
814 </li>
815 </ul>
816 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
817 </li>
818 </ul>
819 </section>
820 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
821 <a name="removeworker" class="tsd-anchor"></a>
822 <h3><span class="tsd-flag ts-flagProtected">Protected</span> remove<wbr>Worker</h3>
823 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
824 <li class="tsd-signature tsd-kind-icon">remove<wbr>Worker<span class="tsd-signature-symbol">(</span>worker<span class="tsd-signature-symbol">: </span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
825 </ul>
826 <ul class="tsd-descriptions">
827 <li class="tsd-description">
828 <aside class="tsd-sources">
829 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#removeworker">removeWorker</a></p>
830 <ul>
849e0547 831 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L342">src/pools/abstract-pool.ts:342</a></li>
5ea22628
JB
832 </ul>
833 </aside>
834 <div class="tsd-comment tsd-typography">
835 <div class="lead">
836 <p>Removes the given worker from the pool.</p>
837 </div>
838 </div>
839 <h4 class="tsd-parameters-title">Parameters</h4>
840 <ul class="tsd-parameters">
841 <li>
842 <h5>worker: <a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a></h5>
843 <div class="tsd-comment tsd-typography">
844 <p>Worker that will be removed.</p>
845 </div>
846 </li>
847 </ul>
848 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
849 </li>
850 </ul>
851 </section>
852 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
853 <a name="sendtoworker" class="tsd-anchor"></a>
854 <h3><span class="tsd-flag ts-flagProtected">Protected</span> send<wbr>ToWorker</h3>
855 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
856 <li class="tsd-signature tsd-kind-icon">send<wbr>ToWorker<span class="tsd-signature-symbol">(</span>worker<span class="tsd-signature-symbol">: </span><a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a>, message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">MessageValue</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Data</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
857 </ul>
858 <ul class="tsd-descriptions">
859 <li class="tsd-description">
860 <aside class="tsd-sources">
861 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#sendtoworker">sendToWorker</a></p>
862 <ul>
849e0547 863 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/thread/fixed.ts#L56">src/pools/thread/fixed.ts:56</a></li>
5ea22628
JB
864 </ul>
865 </aside>
866 <h4 class="tsd-parameters-title">Parameters</h4>
867 <ul class="tsd-parameters">
868 <li>
869 <h5>worker: <a href="../index.html#threadworkerwithmessagechannel" class="tsd-signature-type" data-tsd-kind="Type alias">ThreadWorkerWithMessageChannel</a></h5>
870 </li>
871 <li>
872 <h5>message: <span class="tsd-signature-type">MessageValue</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Data</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">&gt;</span></h5>
873 </li>
874 </ul>
875 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
876 </li>
877 </ul>
878 </section>
879 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
880 <a name="setworkerchoicestrategy" class="tsd-anchor"></a>
881 <h3>set<wbr>Worker<wbr>Choice<wbr>Strategy</h3>
882 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
883 <li class="tsd-signature tsd-kind-icon">set<wbr>Worker<wbr>Choice<wbr>Strategy<span class="tsd-signature-symbol">(</span>workerChoiceStrategy<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;LESS_RECENTLY_USED&quot;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
884 </ul>
885 <ul class="tsd-descriptions">
886 <li class="tsd-description">
887 <aside class="tsd-sources">
888 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#setworkerchoicestrategy">setWorkerChoiceStrategy</a></p>
889 <ul>
849e0547 890 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L237">src/pools/abstract-pool.ts:237</a></li>
5ea22628
JB
891 </ul>
892 </aside>
893 <div class="tsd-comment tsd-typography">
894 <dl class="tsd-comment-tags">
895 <dt>inheritdoc</dt>
896 <dd></dd>
897 </dl>
898 </div>
899 <h4 class="tsd-parameters-title">Parameters</h4>
900 <ul class="tsd-parameters">
901 <li>
902 <h5>workerChoiceStrategy: <span class="tsd-signature-type">&quot;ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LESS_RECENTLY_USED&quot;</span></h5>
903 </li>
904 </ul>
905 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
906 </li>
907 </ul>
908 </section>
909 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
910 <a name="setuphook" class="tsd-anchor"></a>
911 <h3><span class="tsd-flag ts-flagProtected">Protected</span> setup<wbr>Hook</h3>
912 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
913 <li class="tsd-signature tsd-kind-icon">setup<wbr>Hook<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></li>
914 </ul>
915 <ul class="tsd-descriptions">
916 <li class="tsd-description">
917 <aside class="tsd-sources">
918 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#setuphook">setupHook</a></p>
919 <ul>
849e0547 920 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L295">src/pools/abstract-pool.ts:295</a></li>
5ea22628
JB
921 </ul>
922 </aside>
923 <div class="tsd-comment tsd-typography">
924 <div class="lead">
925 <p>Setup hook that can be overridden by a Poolifier pool implementation
926 to run code before workers are created in the abstract constructor.</p>
927 </div>
928 </div>
929 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
930 </li>
931 </ul>
932 </section>
933 <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
934 <a name="workerlistener" class="tsd-anchor"></a>
935 <h3><span class="tsd-flag ts-flagProtected">Protected</span> worker<wbr>Listener</h3>
936 <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
937 <li class="tsd-signature tsd-kind-icon">worker<wbr>Listener<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">MessageValue</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Response</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></li>
938 </ul>
939 <ul class="tsd-descriptions">
940 <li class="tsd-description">
941 <aside class="tsd-sources">
942 <p>Inherited from <a href="fixedthreadpool.html">FixedThreadPool</a>.<a href="fixedthreadpool.html#workerlistener">workerListener</a></p>
943 <ul>
849e0547 944 <li>Defined in <a href="https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/abstract-pool.ts#L432">src/pools/abstract-pool.ts:432</a></li>
5ea22628
JB
945 </ul>
946 </aside>
947 <div class="tsd-comment tsd-typography">
948 <div class="lead">
949 <p>This function is the listener registered for each worker.</p>
950 </div>
951 </div>
952 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">(</span>message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">MessageValue</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Response</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></h4>
953 <p>The listener function to execute when a message is sent from a worker.</p>
954 <ul class="tsd-parameters">
955 <li class="tsd-parameter-signature">
956 <ul class="tsd-signatures tsd-kind-type-literal">
957 <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">MessageValue</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Response</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
958 </ul>
959 <ul class="tsd-descriptions">
960 <li class="tsd-description">
961 <h4 class="tsd-parameters-title">Parameters</h4>
962 <ul class="tsd-parameters">
963 <li>
964 <h5>message: <span class="tsd-signature-type">MessageValue</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Response</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">&gt;</span></h5>
965 </li>
966 </ul>
967 <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
968 </li>
969 </ul>
970 </li>
971 </ul>
972 </li>
973 </ul>
974 </section>
975 </section>
976 </div>
977 <div class="col-4 col-menu menu-sticky-wrap menu-highlight">
978 <nav class="tsd-navigation primary">
979 <ul>
980 <li class=" ">
981 <a href="../index.html">Exports</a>
982 </li>
983 </ul>
984 </nav>
985 <nav class="tsd-navigation secondary menu-sticky">
986 <ul class="before-current">
987 <li class=" tsd-kind-class tsd-has-type-parameter">
988 <a href="abstractworker.html" class="tsd-kind-icon">Abstract<wbr>Worker</a>
989 </li>
990 <li class=" tsd-kind-class tsd-has-type-parameter">
991 <a href="clusterworker.html" class="tsd-kind-icon">Cluster<wbr>Worker</a>
992 </li>
993 <li class=" tsd-kind-class tsd-has-type-parameter">
994 <a href="dynamicclusterpool.html" class="tsd-kind-icon">Dynamic<wbr>Cluster<wbr>Pool</a>
995 </li>
996 </ul>
997 <ul class="current">
998 <li class="current tsd-kind-class tsd-has-type-parameter">
999 <a href="dynamicthreadpool.html" class="tsd-kind-icon">Dynamic<wbr>Thread<wbr>Pool</a>
1000 <ul>
1001 <li class=" tsd-kind-constructor tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited">
1002 <a href="dynamicthreadpool.html#constructor" class="tsd-kind-icon">constructor</a>
1003 </li>
1004 <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
1005 <a href="dynamicthreadpool.html#emitter" class="tsd-kind-icon">emitter</a>
1006 </li>
1007 <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
1008 <a href="dynamicthreadpool.html#filepath" class="tsd-kind-icon">file<wbr>Path</a>
1009 </li>
7c0ba920 1010 <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
5ea22628
JB
1011 <a href="dynamicthreadpool.html#max" class="tsd-kind-icon">max</a>
1012 </li>
1013 <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
1014 <a href="dynamicthreadpool.html#nextmessageid" class="tsd-kind-icon">next<wbr>Message<wbr>Id</a>
1015 </li>
1016 <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
1017 <a href="dynamicthreadpool.html#numberofworkers" class="tsd-kind-icon">number<wbr>OfWorkers</a>
1018 </li>
1019 <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
1020 <a href="dynamicthreadpool.html#opts" class="tsd-kind-icon">opts</a>
1021 </li>
1022 <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
1023 <a href="dynamicthreadpool.html#promisemap" class="tsd-kind-icon">promise<wbr>Map</a>
1024 </li>
1025 <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
1026 <a href="dynamicthreadpool.html#tasks" class="tsd-kind-icon">tasks</a>
1027 </li>
1028 <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
1029 <a href="dynamicthreadpool.html#workerchoicestrategycontext" class="tsd-kind-icon">worker<wbr>Choice<wbr>Strategy<wbr>Context</a>
1030 </li>
1031 <li class=" tsd-kind-property tsd-parent-kind-class tsd-is-inherited">
1032 <a href="dynamicthreadpool.html#workers" class="tsd-kind-icon">workers</a>
1033 </li>
1034 <li class=" tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited">
7c0ba920
JB
1035 <a href="dynamicthreadpool.html#busy" class="tsd-kind-icon">busy</a>
1036 </li>
1037 <li class=" tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited">
1038 <a href="dynamicthreadpool.html#numberofrunningtasks" class="tsd-kind-icon">number<wbr>OfRunning<wbr>Tasks</a>
1039 </li>
1040 <li class=" tsd-kind-get-signature tsd-parent-kind-class tsd-is-inherited">
1041 <a href="dynamicthreadpool.html#type" class="tsd-kind-icon">type</a>
5ea22628
JB
1042 </li>
1043 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
1044 <a href="dynamicthreadpool.html#afterworkersetup" class="tsd-kind-icon">after<wbr>Worker<wbr>Setup</a>
1045 </li>
1046 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
1047 <a href="dynamicthreadpool.html#chooseworker" class="tsd-kind-icon">choose<wbr>Worker</a>
1048 </li>
1049 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
1050 <a href="dynamicthreadpool.html#createandsetupworker" class="tsd-kind-icon">create<wbr>And<wbr>Setup<wbr>Worker</a>
1051 </li>
1052 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
1053 <a href="dynamicthreadpool.html#createworker" class="tsd-kind-icon">create<wbr>Worker</a>
1054 </li>
1055 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
1056 <a href="dynamicthreadpool.html#decreaseworkerstasks" class="tsd-kind-icon">decrease<wbr>Workers<wbr>Tasks</a>
1057 </li>
1058 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
1059 <a href="dynamicthreadpool.html#destroy" class="tsd-kind-icon">destroy</a>
1060 </li>
1061 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
1062 <a href="dynamicthreadpool.html#destroyworker" class="tsd-kind-icon">destroy<wbr>Worker</a>
1063 </li>
1064 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
1065 <a href="dynamicthreadpool.html#execute" class="tsd-kind-icon">execute</a>
1066 </li>
7c0ba920
JB
1067 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
1068 <a href="dynamicthreadpool.html#findfreetasksmapentry" class="tsd-kind-icon">find<wbr>Free<wbr>Tasks<wbr>Map<wbr>Entry</a>
1069 </li>
5ea22628
JB
1070 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
1071 <a href="dynamicthreadpool.html#increaseworkerstask" class="tsd-kind-icon">increase<wbr>Workers<wbr>Task</a>
1072 </li>
1073 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
1074 <a href="dynamicthreadpool.html#internalexecute" class="tsd-kind-icon">internal<wbr>Execute</a>
1075 </li>
7c0ba920
JB
1076 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
1077 <a href="dynamicthreadpool.html#internalgetbusystatus" class="tsd-kind-icon">internal<wbr>Get<wbr>Busy<wbr>Status</a>
1078 </li>
5ea22628
JB
1079 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
1080 <a href="dynamicthreadpool.html#ismain" class="tsd-kind-icon">is<wbr>Main</a>
1081 </li>
1082 <li class=" tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited">
1083 <a href="dynamicthreadpool.html#registerworkermessagelistener" class="tsd-kind-icon">register<wbr>Worker<wbr>Message<wbr>Listener</a>
1084 </li>
1085 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
1086 <a href="dynamicthreadpool.html#removeworker" class="tsd-kind-icon">remove<wbr>Worker</a>
1087 </li>
1088 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
1089 <a href="dynamicthreadpool.html#sendtoworker" class="tsd-kind-icon">send<wbr>ToWorker</a>
1090 </li>
1091 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited">
1092 <a href="dynamicthreadpool.html#setworkerchoicestrategy" class="tsd-kind-icon">set<wbr>Worker<wbr>Choice<wbr>Strategy</a>
1093 </li>
1094 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
1095 <a href="dynamicthreadpool.html#setuphook" class="tsd-kind-icon">setup<wbr>Hook</a>
1096 </li>
1097 <li class=" tsd-kind-method tsd-parent-kind-class tsd-is-inherited tsd-is-protected">
1098 <a href="dynamicthreadpool.html#workerlistener" class="tsd-kind-icon">worker<wbr>Listener</a>
1099 </li>
1100 </ul>
1101 </li>
1102 </ul>
1103 <ul class="after-current">
1104 <li class=" tsd-kind-class tsd-has-type-parameter">
1105 <a href="fixedclusterpool.html" class="tsd-kind-icon">Fixed<wbr>Cluster<wbr>Pool</a>
1106 </li>
1107 <li class=" tsd-kind-class tsd-has-type-parameter">
1108 <a href="fixedthreadpool.html" class="tsd-kind-icon">Fixed<wbr>Thread<wbr>Pool</a>
1109 </li>
1110 <li class=" tsd-kind-class tsd-has-type-parameter">
1111 <a href="threadworker.html" class="tsd-kind-icon">Thread<wbr>Worker</a>
1112 </li>
1113 <li class=" tsd-kind-interface">
1114 <a href="../interfaces/clusterpooloptions.html" class="tsd-kind-icon">Cluster<wbr>Pool<wbr>Options</a>
1115 </li>
1116 <li class=" tsd-kind-interface tsd-has-type-parameter">
1117 <a href="../interfaces/ipool.html" class="tsd-kind-icon">IPool</a>
1118 </li>
1119 <li class=" tsd-kind-interface">
1120 <a href="../interfaces/iworker.html" class="tsd-kind-icon">IWorker</a>
1121 </li>
1122 <li class=" tsd-kind-interface tsd-has-type-parameter">
1123 <a href="../interfaces/pooloptions.html" class="tsd-kind-icon">Pool<wbr>Options</a>
1124 </li>
1125 <li class=" tsd-kind-interface">
1126 <a href="../interfaces/workeroptions.html" class="tsd-kind-icon">Worker<wbr>Options</a>
1127 </li>
1128 <li class=" tsd-kind-type-alias tsd-has-type-parameter">
1129 <a href="../index.html#errorhandler" class="tsd-kind-icon">Error<wbr>Handler</a>
1130 </li>
1131 <li class=" tsd-kind-type-alias tsd-has-type-parameter">
1132 <a href="../index.html#exithandler" class="tsd-kind-icon">Exit<wbr>Handler</a>
1133 </li>
1134 <li class=" tsd-kind-type-alias">
1135 <a href="../index.html#killbehavior" class="tsd-kind-icon">Kill<wbr>Behavior</a>
1136 </li>
1137 <li class=" tsd-kind-type-alias tsd-has-type-parameter">
1138 <a href="../index.html#onlinehandler" class="tsd-kind-icon">Online<wbr>Handler</a>
1139 </li>
1140 <li class=" tsd-kind-type-alias">
1141 <a href="../index.html#threadworkerwithmessagechannel" class="tsd-kind-icon">Thread<wbr>Worker<wbr>With<wbr>Message<wbr>Channel</a>
1142 </li>
1143 <li class=" tsd-kind-type-alias">
1144 <a href="../index.html#workerchoicestrategy" class="tsd-kind-icon">Worker<wbr>Choice<wbr>Strategy</a>
1145 </li>
1146 <li class=" tsd-kind-variable">
1147 <a href="../index.html#killbehaviors" class="tsd-kind-icon">Kill<wbr>Behaviors</a>
1148 </li>
1149 <li class=" tsd-kind-variable">
1150 <a href="../index.html#workerchoicestrategies" class="tsd-kind-icon">Worker<wbr>Choice<wbr>Strategies</a>
1151 </li>
1152 </ul>
1153 </nav>
1154 </div>
1155 </div>
1156</div>
1157<footer class="with-border-bottom">
1158 <div class="container">
1159 <h2>Legend</h2>
1160 <div class="tsd-legend-group">
1161 <ul class="tsd-legend">
1162 <li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
1163 <li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
1164 </ul>
1165 <ul class="tsd-legend">
1166 <li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
1167 <li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
1168 </ul>
1169 <ul class="tsd-legend">
1170 <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
1171 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
1172 </ul>
1173 <ul class="tsd-legend">
1174 <li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
1175 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
1176 </ul>
1177 <ul class="tsd-legend">
1178 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
1179 </ul>
1180 </div>
1181 </div>
1182</footer>
1183<div class="container tsd-generator">
1184 <p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
1185</div>
1186<div class="overlay"></div>
1187<script src="../assets/js/main.js"></script>
1188</body>
1189</html>