2 <html class=
"default no-js">
5 <meta http-equiv=
"X-UA-Compatible" content=
"IE=edge">
6 <title>IPool | 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>
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=
"..">
19 <label for=
"tsd-search-field" class=
"tsd-widget search no-caption">Search
</label>
20 <input id=
"tsd-search-field" type=
"text" />
23 <li class=
"state loading">Preparing search index...
</li>
24 <li class=
"state failure">The search index is not available
</li>
26 <a href=
"../index.html" class=
"title">poolifier
</a>
28 <div class=
"table-cell" id=
"tsd-widgets">
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>
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>
46 <a href=
"#" class=
"tsd-widget menu no-caption" data-toggle=
"menu">Menu
</a>
51 <div class=
"tsd-page-title">
52 <div class=
"container">
53 <ul class=
"tsd-breadcrumb">
55 <a href=
"../index.html">poolifier
</a>
58 <a href=
"ipool.html">IPool
</a>
61 <h1>Interface IPool
<Data, Response
></h1>
65 <div class=
"container container-main">
67 <div class=
"col-8 col-content">
68 <section class=
"tsd-panel tsd-comment">
69 <div class=
"tsd-comment tsd-typography">
71 <p>Contract definition for a poolifier pool.
</p>
75 <section class=
"tsd-panel tsd-type-parameters">
76 <h3>Type parameters
</h3>
77 <ul class=
"tsd-type-parameters">
79 <h4>Data =
<span class=
"tsd-signature-type">unknown
</span></h4>
80 <div class=
"tsd-comment tsd-typography">
82 <p>Type of data sent to the worker. This can only be serializable data.
</p>
87 <h4>Response =
<span class=
"tsd-signature-type">unknown
</span></h4>
88 <div class=
"tsd-comment tsd-typography">
90 <p>Type of response of execution. This can only be serializable data.
</p>
96 <section class=
"tsd-panel tsd-hierarchy">
98 <ul class=
"tsd-hierarchy">
100 <span class=
"target">IPool
</span>
104 <section class=
"tsd-panel-group tsd-index-group">
106 <section class=
"tsd-panel tsd-index-panel">
107 <div class=
"tsd-index-content">
108 <section class=
"tsd-index-section ">
110 <ul class=
"tsd-index-list">
111 <li class=
"tsd-kind-method tsd-parent-kind-interface"><a href=
"ipool.html#destroy" class=
"tsd-kind-icon">destroy
</a></li>
112 <li class=
"tsd-kind-method tsd-parent-kind-interface"><a href=
"ipool.html#execute" class=
"tsd-kind-icon">execute
</a></li>
113 <li class=
"tsd-kind-method tsd-parent-kind-interface"><a href=
"ipool.html#setworkerchoicestrategy" class=
"tsd-kind-icon">set
<wbr>Worker
<wbr>Choice
<wbr>Strategy
</a></li>
119 <section class=
"tsd-panel-group tsd-member-group ">
121 <section class=
"tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
122 <a name=
"destroy" class=
"tsd-anchor"></a>
124 <ul class=
"tsd-signatures tsd-kind-method tsd-parent-kind-interface">
125 <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"><</span><span class=
"tsd-signature-type">void
</span><span class=
"tsd-signature-symbol">></span></li>
127 <ul class=
"tsd-descriptions">
128 <li class=
"tsd-description">
129 <aside class=
"tsd-sources">
131 <li>Defined in
<a href=
"https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/pool.ts#L20">src/pools/pool.ts:
20</a></li>
134 <div class=
"tsd-comment tsd-typography">
136 <p>Shut down every current worker in this pool.
</p>
139 <h4 class=
"tsd-returns-title">Returns
<span class=
"tsd-signature-type">Promise
</span><span class=
"tsd-signature-symbol"><</span><span class=
"tsd-signature-type">void
</span><span class=
"tsd-signature-symbol">></span></h4>
143 <section class=
"tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
144 <a name=
"execute" class=
"tsd-anchor"></a>
146 <ul class=
"tsd-signatures tsd-kind-method tsd-parent-kind-interface">
147 <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"><</span><span class=
"tsd-signature-type">Response
</span><span class=
"tsd-signature-symbol">></span></li>
149 <ul class=
"tsd-descriptions">
150 <li class=
"tsd-description">
151 <aside class=
"tsd-sources">
153 <li>Defined in
<a href=
"https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/pool.ts#L16">src/pools/pool.ts:
16</a></li>
156 <div class=
"tsd-comment tsd-typography">
158 <p>Perform the task specified in the constructor with the data parameter.
</p>
161 <h4 class=
"tsd-parameters-title">Parameters
</h4>
162 <ul class=
"tsd-parameters">
164 <h5>data:
<span class=
"tsd-signature-type">Data
</span></h5>
165 <div class=
"tsd-comment tsd-typography">
166 <p>The input for the specified task. This can only be serializable data.
</p>
170 <h4 class=
"tsd-returns-title">Returns
<span class=
"tsd-signature-type">Promise
</span><span class=
"tsd-signature-symbol"><</span><span class=
"tsd-signature-type">Response
</span><span class=
"tsd-signature-symbol">></span></h4>
171 <p>Promise that will be resolved when the task is successfully completed.
</p>
175 <section class=
"tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface">
176 <a name=
"setworkerchoicestrategy" class=
"tsd-anchor"></a>
177 <h3>set
<wbr>Worker
<wbr>Choice
<wbr>Strategy
</h3>
178 <ul class=
"tsd-signatures tsd-kind-method tsd-parent-kind-interface">
179 <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">"ROUND_ROBIN
"</span><span class=
"tsd-signature-symbol"> |
</span><span class=
"tsd-signature-type">"LESS_RECENTLY_USED
"</span><span class=
"tsd-signature-symbol">)
</span><span class=
"tsd-signature-symbol">:
</span><span class=
"tsd-signature-type">void
</span></li>
181 <ul class=
"tsd-descriptions">
182 <li class=
"tsd-description">
183 <aside class=
"tsd-sources">
185 <li>Defined in
<a href=
"https://github.com/pioardi/poolifier/blob/36b71cf/src/pools/pool.ts#L26">src/pools/pool.ts:
26</a></li>
188 <div class=
"tsd-comment tsd-typography">
190 <p>Set the worker choice strategy in this pool.
</p>
193 <h4 class=
"tsd-parameters-title">Parameters
</h4>
194 <ul class=
"tsd-parameters">
196 <h5>workerChoiceStrategy:
<span class=
"tsd-signature-type">"ROUND_ROBIN
"</span><span class=
"tsd-signature-symbol"> |
</span><span class=
"tsd-signature-type">"LESS_RECENTLY_USED
"</span></h5>
197 <div class=
"tsd-comment tsd-typography">
198 <p>The worker choice strategy.
</p>
202 <h4 class=
"tsd-returns-title">Returns
<span class=
"tsd-signature-type">void
</span></h4>
208 <div class=
"col-4 col-menu menu-sticky-wrap menu-highlight">
209 <nav class=
"tsd-navigation primary">
212 <a href=
"../index.html">Exports
</a>
216 <nav class=
"tsd-navigation secondary menu-sticky">
217 <ul class=
"before-current">
218 <li class=
" tsd-kind-class tsd-has-type-parameter">
219 <a href=
"../classes/abstractworker.html" class=
"tsd-kind-icon">Abstract
<wbr>Worker
</a>
221 <li class=
" tsd-kind-class tsd-has-type-parameter">
222 <a href=
"../classes/clusterworker.html" class=
"tsd-kind-icon">Cluster
<wbr>Worker
</a>
224 <li class=
" tsd-kind-class tsd-has-type-parameter">
225 <a href=
"../classes/dynamicclusterpool.html" class=
"tsd-kind-icon">Dynamic
<wbr>Cluster
<wbr>Pool
</a>
227 <li class=
" tsd-kind-class tsd-has-type-parameter">
228 <a href=
"../classes/dynamicthreadpool.html" class=
"tsd-kind-icon">Dynamic
<wbr>Thread
<wbr>Pool
</a>
230 <li class=
" tsd-kind-class tsd-has-type-parameter">
231 <a href=
"../classes/fixedclusterpool.html" class=
"tsd-kind-icon">Fixed
<wbr>Cluster
<wbr>Pool
</a>
233 <li class=
" tsd-kind-class tsd-has-type-parameter">
234 <a href=
"../classes/fixedthreadpool.html" class=
"tsd-kind-icon">Fixed
<wbr>Thread
<wbr>Pool
</a>
236 <li class=
" tsd-kind-class tsd-has-type-parameter">
237 <a href=
"../classes/threadworker.html" class=
"tsd-kind-icon">Thread
<wbr>Worker
</a>
239 <li class=
" tsd-kind-interface">
240 <a href=
"clusterpooloptions.html" class=
"tsd-kind-icon">Cluster
<wbr>Pool
<wbr>Options
</a>
244 <li class=
"current tsd-kind-interface tsd-has-type-parameter">
245 <a href=
"ipool.html" class=
"tsd-kind-icon">IPool
</a>
247 <li class=
" tsd-kind-method tsd-parent-kind-interface">
248 <a href=
"ipool.html#destroy" class=
"tsd-kind-icon">destroy
</a>
250 <li class=
" tsd-kind-method tsd-parent-kind-interface">
251 <a href=
"ipool.html#execute" class=
"tsd-kind-icon">execute
</a>
253 <li class=
" tsd-kind-method tsd-parent-kind-interface">
254 <a href=
"ipool.html#setworkerchoicestrategy" class=
"tsd-kind-icon">set
<wbr>Worker
<wbr>Choice
<wbr>Strategy
</a>
259 <ul class=
"after-current">
260 <li class=
" tsd-kind-interface">
261 <a href=
"iworker.html" class=
"tsd-kind-icon">IWorker
</a>
263 <li class=
" tsd-kind-interface tsd-has-type-parameter">
264 <a href=
"pooloptions.html" class=
"tsd-kind-icon">Pool
<wbr>Options
</a>
266 <li class=
" tsd-kind-interface">
267 <a href=
"workeroptions.html" class=
"tsd-kind-icon">Worker
<wbr>Options
</a>
269 <li class=
" tsd-kind-type-alias tsd-has-type-parameter">
270 <a href=
"../index.html#errorhandler" class=
"tsd-kind-icon">Error
<wbr>Handler
</a>
272 <li class=
" tsd-kind-type-alias tsd-has-type-parameter">
273 <a href=
"../index.html#exithandler" class=
"tsd-kind-icon">Exit
<wbr>Handler
</a>
275 <li class=
" tsd-kind-type-alias">
276 <a href=
"../index.html#killbehavior" class=
"tsd-kind-icon">Kill
<wbr>Behavior
</a>
278 <li class=
" tsd-kind-type-alias tsd-has-type-parameter">
279 <a href=
"../index.html#onlinehandler" class=
"tsd-kind-icon">Online
<wbr>Handler
</a>
281 <li class=
" tsd-kind-type-alias">
282 <a href=
"../index.html#threadworkerwithmessagechannel" class=
"tsd-kind-icon">Thread
<wbr>Worker
<wbr>With
<wbr>Message
<wbr>Channel
</a>
284 <li class=
" tsd-kind-type-alias">
285 <a href=
"../index.html#workerchoicestrategy" class=
"tsd-kind-icon">Worker
<wbr>Choice
<wbr>Strategy
</a>
287 <li class=
" tsd-kind-variable">
288 <a href=
"../index.html#killbehaviors" class=
"tsd-kind-icon">Kill
<wbr>Behaviors
</a>
290 <li class=
" tsd-kind-variable">
291 <a href=
"../index.html#workerchoicestrategies" class=
"tsd-kind-icon">Worker
<wbr>Choice
<wbr>Strategies
</a>
298 <footer class=
"with-border-bottom">
299 <div class=
"container">
301 <div class=
"tsd-legend-group">
302 <ul class=
"tsd-legend">
303 <li class=
"tsd-kind-property tsd-parent-kind-interface"><span class=
"tsd-kind-icon">Property
</span></li>
304 <li class=
"tsd-kind-method tsd-parent-kind-interface"><span class=
"tsd-kind-icon">Method
</span></li>
306 <ul class=
"tsd-legend">
307 <li class=
"tsd-kind-property tsd-parent-kind-class"><span class=
"tsd-kind-icon">Property
</span></li>
308 <li class=
"tsd-kind-method tsd-parent-kind-class"><span class=
"tsd-kind-icon">Method
</span></li>
310 <ul class=
"tsd-legend">
311 <li class=
"tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class=
"tsd-kind-icon">Inherited property
</span></li>
312 <li class=
"tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class=
"tsd-kind-icon">Inherited method
</span></li>
314 <ul class=
"tsd-legend">
315 <li class=
"tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class=
"tsd-kind-icon">Protected property
</span></li>
316 <li class=
"tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class=
"tsd-kind-icon">Protected method
</span></li>
318 <ul class=
"tsd-legend">
319 <li class=
"tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class=
"tsd-kind-icon">Private method
</span></li>
324 <div class=
"container tsd-generator">
325 <p>Generated using
<a href=
"https://typedoc.org/" target=
"_blank">TypeDoc
</a></p>
327 <div class=
"overlay"></div>
328 <script src=
"../assets/js/main.js"></script>