Add two tests to assess worker options. (#260)
[poolifier.git] / docs / interfaces / clusterpooloptions.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>ClusterPoolOptions | 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="clusterpooloptions.html">ClusterPoolOptions</a>
59 </li>
60 </ul>
61 <h1>Interface ClusterPoolOptions</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>Options for a poolifier cluster pool.</p>
72 </div>
73 </div>
74 </section>
75 <section class="tsd-panel tsd-hierarchy">
76 <h3>Hierarchy</h3>
77 <ul class="tsd-hierarchy">
78 <li>
79 <a href="pooloptions.html" class="tsd-signature-type" data-tsd-kind="Interface">PoolOptions</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Worker</span><span class="tsd-signature-symbol">&gt;</span>
80 <ul class="tsd-hierarchy">
81 <li>
82 <span class="target">ClusterPoolOptions</span>
83 </li>
84 </ul>
85 </li>
86 </ul>
87 </section>
88 <section class="tsd-panel-group tsd-index-group">
89 <h2>Index</h2>
90 <section class="tsd-panel tsd-index-panel">
91 <div class="tsd-index-content">
92 <section class="tsd-index-section ">
93 <h3>Properties</h3>
94 <ul class="tsd-index-list">
7c0ba920 95 <li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="clusterpooloptions.html#enableevents" class="tsd-kind-icon">enable<wbr>Events</a></li>
5ea22628
JB
96 <li class="tsd-kind-property tsd-parent-kind-interface"><a href="clusterpooloptions.html#env" class="tsd-kind-icon">env</a></li>
97 <li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="clusterpooloptions.html#errorhandler" class="tsd-kind-icon">error<wbr>Handler</a></li>
98 <li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="clusterpooloptions.html#exithandler" class="tsd-kind-icon">exit<wbr>Handler</a></li>
99 <li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="clusterpooloptions.html#onlinehandler" class="tsd-kind-icon">online<wbr>Handler</a></li>
100 <li class="tsd-kind-property tsd-parent-kind-interface tsd-is-inherited"><a href="clusterpooloptions.html#workerchoicestrategy" class="tsd-kind-icon">worker<wbr>Choice<wbr>Strategy</a></li>
101 </ul>
102 </section>
103 </div>
104 </section>
105 </section>
106 <section class="tsd-panel-group tsd-member-group ">
107 <h2>Properties</h2>
7c0ba920
JB
108 <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
109 <a name="enableevents" class="tsd-anchor"></a>
110 <h3><span class="tsd-flag ts-flagOptional">Optional</span> enable<wbr>Events</h3>
111 <div class="tsd-signature tsd-kind-icon">enable<wbr>Events<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>
112 <aside class="tsd-sources">
113 <p>Inherited from <a href="pooloptions.html">PoolOptions</a>.<a href="pooloptions.html#enableevents">enableEvents</a></p>
114 <ul>
115 <li>Defined in <a href="https://github.com/jerome-benoit/poolifier/blob/7fb595d/src/pools/abstract-pool.ts#L95">src/pools/abstract-pool.ts:95</a></li>
116 </ul>
117 </aside>
118 <div class="tsd-comment tsd-typography">
119 <div class="lead">
120 <p>Pool events emission.</p>
121 </div>
122 <p>Default to true.</p>
123 </div>
124 </section>
5ea22628
JB
125 <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
126 <a name="env" class="tsd-anchor"></a>
127 <h3><span class="tsd-flag ts-flagOptional">Optional</span> env</h3>
128 <div class="tsd-signature tsd-kind-icon">env<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span></div>
129 <aside class="tsd-sources">
130 <ul>
7c0ba920 131 <li>Defined in <a href="https://github.com/jerome-benoit/poolifier/blob/7fb595d/src/pools/cluster/fixed.ts#L17">src/pools/cluster/fixed.ts:17</a></li>
5ea22628
JB
132 </ul>
133 </aside>
134 <div class="tsd-comment tsd-typography">
135 <div class="lead">
136 <p>Key/value pairs to add to worker process environment.</p>
137 </div>
138 <dl class="tsd-comment-tags">
139 <dt>see</dt>
140 <dd><p><a href="https://nodejs.org/api/cluster.html#cluster_cluster_fork_env">https://nodejs.org/api/cluster.html#cluster_cluster_fork_env</a></p>
141 </dd>
142 </dl>
143 </div>
144 </section>
145 <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
146 <a name="errorhandler" class="tsd-anchor"></a>
147 <h3><span class="tsd-flag ts-flagOptional">Optional</span> error<wbr>Handler</h3>
148 <div class="tsd-signature tsd-kind-icon">error<wbr>Handler<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="../index.html#errorhandler" class="tsd-signature-type" data-tsd-kind="Type alias">ErrorHandler</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Worker</span><span class="tsd-signature-symbol">&gt;</span></div>
149 <aside class="tsd-sources">
150 <p>Inherited from <a href="pooloptions.html">PoolOptions</a>.<a href="pooloptions.html#errorhandler">errorHandler</a></p>
151 <ul>
7c0ba920 152 <li>Defined in <a href="https://github.com/jerome-benoit/poolifier/blob/7fb595d/src/pools/abstract-pool.ts#L77">src/pools/abstract-pool.ts:77</a></li>
5ea22628
JB
153 </ul>
154 </aside>
155 <div class="tsd-comment tsd-typography">
156 <div class="lead">
157 <p>A function that will listen for error event on each worker.</p>
158 </div>
159 </div>
160 </section>
161 <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
162 <a name="exithandler" class="tsd-anchor"></a>
163 <h3><span class="tsd-flag ts-flagOptional">Optional</span> exit<wbr>Handler</h3>
164 <div class="tsd-signature tsd-kind-icon">exit<wbr>Handler<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="../index.html#exithandler" class="tsd-signature-type" data-tsd-kind="Type alias">ExitHandler</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Worker</span><span class="tsd-signature-symbol">&gt;</span></div>
165 <aside class="tsd-sources">
166 <p>Inherited from <a href="pooloptions.html">PoolOptions</a>.<a href="pooloptions.html#exithandler">exitHandler</a></p>
167 <ul>
7c0ba920 168 <li>Defined in <a href="https://github.com/jerome-benoit/poolifier/blob/7fb595d/src/pools/abstract-pool.ts#L85">src/pools/abstract-pool.ts:85</a></li>
5ea22628
JB
169 </ul>
170 </aside>
171 <div class="tsd-comment tsd-typography">
172 <div class="lead">
173 <p>A function that will listen for exit event on each worker.</p>
174 </div>
175 </div>
176 </section>
177 <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
178 <a name="onlinehandler" class="tsd-anchor"></a>
179 <h3><span class="tsd-flag ts-flagOptional">Optional</span> online<wbr>Handler</h3>
180 <div class="tsd-signature tsd-kind-icon">online<wbr>Handler<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="../index.html#onlinehandler" class="tsd-signature-type" data-tsd-kind="Type alias">OnlineHandler</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Worker</span><span class="tsd-signature-symbol">&gt;</span></div>
181 <aside class="tsd-sources">
182 <p>Inherited from <a href="pooloptions.html">PoolOptions</a>.<a href="pooloptions.html#onlinehandler">onlineHandler</a></p>
183 <ul>
7c0ba920 184 <li>Defined in <a href="https://github.com/jerome-benoit/poolifier/blob/7fb595d/src/pools/abstract-pool.ts#L81">src/pools/abstract-pool.ts:81</a></li>
5ea22628
JB
185 </ul>
186 </aside>
187 <div class="tsd-comment tsd-typography">
188 <div class="lead">
189 <p>A function that will listen for online event on each worker.</p>
190 </div>
191 </div>
192 </section>
193 <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
194 <a name="workerchoicestrategy" class="tsd-anchor"></a>
195 <h3><span class="tsd-flag ts-flagOptional">Optional</span> worker<wbr>Choice<wbr>Strategy</h3>
196 <div class="tsd-signature tsd-kind-icon">worker<wbr>Choice<wbr>Strategy<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;ROUND_ROBIN&quot;</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">&quot;LESS_RECENTLY_USED&quot;</span></div>
197 <aside class="tsd-sources">
198 <p>Inherited from <a href="pooloptions.html">PoolOptions</a>.<a href="pooloptions.html#workerchoicestrategy">workerChoiceStrategy</a></p>
199 <ul>
7c0ba920 200 <li>Defined in <a href="https://github.com/jerome-benoit/poolifier/blob/7fb595d/src/pools/abstract-pool.ts#L89">src/pools/abstract-pool.ts:89</a></li>
5ea22628
JB
201 </ul>
202 </aside>
203 <div class="tsd-comment tsd-typography">
204 <div class="lead">
205 <p>The work choice strategy to use in this pool.</p>
206 </div>
207 </div>
208 </section>
209 </section>
210 </div>
211 <div class="col-4 col-menu menu-sticky-wrap menu-highlight">
212 <nav class="tsd-navigation primary">
213 <ul>
214 <li class=" ">
215 <a href="../index.html">Exports</a>
216 </li>
217 </ul>
218 </nav>
219 <nav class="tsd-navigation secondary menu-sticky">
220 <ul class="before-current">
221 <li class=" tsd-kind-class tsd-has-type-parameter">
222 <a href="../classes/abstractworker.html" class="tsd-kind-icon">Abstract<wbr>Worker</a>
223 </li>
224 <li class=" tsd-kind-class tsd-has-type-parameter">
225 <a href="../classes/clusterworker.html" class="tsd-kind-icon">Cluster<wbr>Worker</a>
226 </li>
227 <li class=" tsd-kind-class tsd-has-type-parameter">
228 <a href="../classes/dynamicclusterpool.html" class="tsd-kind-icon">Dynamic<wbr>Cluster<wbr>Pool</a>
229 </li>
230 <li class=" tsd-kind-class tsd-has-type-parameter">
231 <a href="../classes/dynamicthreadpool.html" class="tsd-kind-icon">Dynamic<wbr>Thread<wbr>Pool</a>
232 </li>
233 <li class=" tsd-kind-class tsd-has-type-parameter">
234 <a href="../classes/fixedclusterpool.html" class="tsd-kind-icon">Fixed<wbr>Cluster<wbr>Pool</a>
235 </li>
236 <li class=" tsd-kind-class tsd-has-type-parameter">
237 <a href="../classes/fixedthreadpool.html" class="tsd-kind-icon">Fixed<wbr>Thread<wbr>Pool</a>
238 </li>
239 <li class=" tsd-kind-class tsd-has-type-parameter">
240 <a href="../classes/threadworker.html" class="tsd-kind-icon">Thread<wbr>Worker</a>
241 </li>
242 </ul>
243 <ul class="current">
244 <li class="current tsd-kind-interface">
245 <a href="clusterpooloptions.html" class="tsd-kind-icon">Cluster<wbr>Pool<wbr>Options</a>
246 <ul>
7c0ba920
JB
247 <li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
248 <a href="clusterpooloptions.html#enableevents" class="tsd-kind-icon">enable<wbr>Events</a>
249 </li>
5ea22628
JB
250 <li class=" tsd-kind-property tsd-parent-kind-interface">
251 <a href="clusterpooloptions.html#env" class="tsd-kind-icon">env</a>
252 </li>
253 <li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
254 <a href="clusterpooloptions.html#errorhandler" class="tsd-kind-icon">error<wbr>Handler</a>
255 </li>
256 <li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
257 <a href="clusterpooloptions.html#exithandler" class="tsd-kind-icon">exit<wbr>Handler</a>
258 </li>
259 <li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
260 <a href="clusterpooloptions.html#onlinehandler" class="tsd-kind-icon">online<wbr>Handler</a>
261 </li>
262 <li class=" tsd-kind-property tsd-parent-kind-interface tsd-is-inherited">
263 <a href="clusterpooloptions.html#workerchoicestrategy" class="tsd-kind-icon">worker<wbr>Choice<wbr>Strategy</a>
264 </li>
265 </ul>
266 </li>
267 </ul>
268 <ul class="after-current">
269 <li class=" tsd-kind-interface tsd-has-type-parameter">
270 <a href="ipool.html" class="tsd-kind-icon">IPool</a>
271 </li>
272 <li class=" tsd-kind-interface">
273 <a href="iworker.html" class="tsd-kind-icon">IWorker</a>
274 </li>
275 <li class=" tsd-kind-interface tsd-has-type-parameter">
276 <a href="pooloptions.html" class="tsd-kind-icon">Pool<wbr>Options</a>
277 </li>
278 <li class=" tsd-kind-interface">
279 <a href="workeroptions.html" class="tsd-kind-icon">Worker<wbr>Options</a>
280 </li>
281 <li class=" tsd-kind-type-alias tsd-has-type-parameter">
282 <a href="../index.html#errorhandler" class="tsd-kind-icon">Error<wbr>Handler</a>
283 </li>
284 <li class=" tsd-kind-type-alias tsd-has-type-parameter">
285 <a href="../index.html#exithandler" class="tsd-kind-icon">Exit<wbr>Handler</a>
286 </li>
287 <li class=" tsd-kind-type-alias">
288 <a href="../index.html#killbehavior" class="tsd-kind-icon">Kill<wbr>Behavior</a>
289 </li>
290 <li class=" tsd-kind-type-alias tsd-has-type-parameter">
291 <a href="../index.html#onlinehandler" class="tsd-kind-icon">Online<wbr>Handler</a>
292 </li>
293 <li class=" tsd-kind-type-alias">
294 <a href="../index.html#threadworkerwithmessagechannel" class="tsd-kind-icon">Thread<wbr>Worker<wbr>With<wbr>Message<wbr>Channel</a>
295 </li>
296 <li class=" tsd-kind-type-alias">
297 <a href="../index.html#workerchoicestrategy" class="tsd-kind-icon">Worker<wbr>Choice<wbr>Strategy</a>
298 </li>
299 <li class=" tsd-kind-variable">
300 <a href="../index.html#killbehaviors" class="tsd-kind-icon">Kill<wbr>Behaviors</a>
301 </li>
302 <li class=" tsd-kind-variable">
303 <a href="../index.html#workerchoicestrategies" class="tsd-kind-icon">Worker<wbr>Choice<wbr>Strategies</a>
304 </li>
305 </ul>
306 </nav>
307 </div>
308 </div>
309</div>
310<footer class="with-border-bottom">
311 <div class="container">
312 <h2>Legend</h2>
313 <div class="tsd-legend-group">
314 <ul class="tsd-legend">
315 <li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
316 <li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
317 </ul>
318 <ul class="tsd-legend">
319 <li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
320 <li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
321 </ul>
322 <ul class="tsd-legend">
323 <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
324 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
325 </ul>
326 <ul class="tsd-legend">
327 <li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
328 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
329 </ul>
330 <ul class="tsd-legend">
331 <li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
332 </ul>
333 </div>
334 </div>
335</footer>
336<div class="container tsd-generator">
337 <p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
338</div>
339<div class="overlay"></div>
340<script src="../assets/js/main.js"></script>
341</body>
342</html>