chore: generate documentation
[poolifier.git] / docs / classes / PoolEmitter.html
CommitLineData
3c7c9bd1 1<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>PoolEmitter | poolifier - v2.6.21</title><meta name="description" content="Documentation for poolifier"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/search.js" id="tsd-search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
41015374
JB
2<div class="tsd-toolbar-contents container">
3<div class="table-cell" id="tsd-search" data-base="..">
4<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
5<div class="field">
6<div id="tsd-toolbar-links"></div></div>
7<ul class="results">
8<li class="state loading">Preparing search index...</li>
3c7c9bd1 9<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">poolifier - v2.6.21</a></div>
41015374
JB
10<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
11<div class="container container-main">
ec06e4dd 12<div class="col-content">
41015374
JB
13<div class="tsd-page-title">
14<ul class="tsd-breadcrumb">
15<li><a href="../index.html">poolifier</a></li>
16<li><a href="PoolEmitter.html">PoolEmitter</a></li></ul>
17<h1>Class PoolEmitter</h1></div>
18<section class="tsd-panel tsd-comment">
19<div class="tsd-comment tsd-typography"><p>Pool events emitter.</p>
15d6dfaf 20</div>
21<div class="tsd-comment tsd-typography"></div></section>
41015374
JB
22<section class="tsd-panel tsd-hierarchy">
23<h4>Hierarchy</h4>
24<ul class="tsd-hierarchy">
3bd6a82e 25<li><span class="tsd-signature-type ">EventEmitter</span>
41015374
JB
26<ul class="tsd-hierarchy">
27<li><span class="target">PoolEmitter</span></li></ul></li></ul></section><aside class="tsd-sources">
28<ul>
3c7c9bd1 29<li>Defined in <a href="https://github.com/poolifier/poolifier/blob/d9647bd/src/pools/pool.ts#L38">src/pools/pool.ts:38</a></li></ul></aside>
41015374
JB
30<section class="tsd-panel-group tsd-index-group">
31<section class="tsd-panel tsd-index-panel">
32<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
33<h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex=0><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-text)"></path></svg> Index</h5></summary>
34<div class="tsd-accordion-details">
35<section class="tsd-index-section">
36<h3 class="tsd-index-heading">Constructors</h3>
15d6dfaf 37<div class="tsd-index-list"><a href="PoolEmitter.html#constructor" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-512"><rect fill="var(--color-icon-background)" stroke="#4D7FFF" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g></svg><span>constructor</span></a>
41015374
JB
38</div></section>
39<section class="tsd-index-section">
40<h3 class="tsd-index-heading">Properties</h3>
15d6dfaf 41<div class="tsd-index-list"><a href="PoolEmitter.html#captureRejectionSymbol" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-1024"><rect fill="var(--color-icon-background)" stroke="#FF984D" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.354 16V7.24H12.174C12.99 7.24 13.638 7.476 14.118 7.948C14.606 8.412 14.85 9.036 14.85 9.82C14.85 10.604 14.606 11.232 14.118 11.704C13.638 12.168 12.99 12.4 12.174 12.4H10.434V16H9.354ZM10.434 11.428H12.174C12.646 11.428 13.022 11.284 13.302 10.996C13.59 10.7 13.734 10.308 13.734 9.82C13.734 9.324 13.59 8.932 13.302 8.644C13.022 8.356 12.646 8.212 12.174 8.212H10.434V11.428Z" fill="var(--color-text)"></path></g></svg><span>capture<wbr/>Rejection<wbr/>Symbol</span></a>
42<a href="PoolEmitter.html#captureRejections" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>capture<wbr/>Rejections</span></a>
43<a href="PoolEmitter.html#defaultMaxListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>default<wbr/>Max<wbr/>Listeners</span></a>
44<a href="PoolEmitter.html#errorMonitor" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>error<wbr/>Monitor</span></a>
41015374
JB
45</div></section>
46<section class="tsd-index-section">
47<h3 class="tsd-index-heading">Methods</h3>
15d6dfaf 48<div class="tsd-index-list"><a href="PoolEmitter.html#addListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-2048"><rect fill="var(--color-icon-background)" stroke="#FF4DB8" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><path d="M9.162 16V7.24H10.578L11.514 10.072C11.602 10.328 11.674 10.584 11.73 10.84C11.794 11.088 11.842 11.28 11.874 11.416C11.906 11.28 11.954 11.088 12.018 10.84C12.082 10.584 12.154 10.324 12.234 10.06L13.122 7.24H14.538V16H13.482V12.82C13.482 12.468 13.49 12.068 13.506 11.62C13.53 11.172 13.558 10.716 13.59 10.252C13.622 9.78 13.654 9.332 13.686 8.908C13.726 8.476 13.762 8.1 13.794 7.78L12.366 12.16H11.334L9.894 7.78C9.934 8.092 9.97 8.456 10.002 8.872C10.042 9.28 10.078 9.716 10.11 10.18C10.142 10.636 10.166 11.092 10.182 11.548C10.206 12.004 10.218 12.428 10.218 12.82V16H9.162Z" fill="var(--color-text)"></path></g></svg><span>add<wbr/>Listener</span></a>
49<a href="PoolEmitter.html#emit" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>emit</span></a>
50<a href="PoolEmitter.html#eventNames" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>event<wbr/>Names</span></a>
51<a href="PoolEmitter.html#getMaxListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Max<wbr/>Listeners</span></a>
52<a href="PoolEmitter.html#listenerCount" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>listener<wbr/>Count</span></a>
53<a href="PoolEmitter.html#listeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>listeners</span></a>
54<a href="PoolEmitter.html#off" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>off</span></a>
55<a href="PoolEmitter.html#on" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>on</span></a>
56<a href="PoolEmitter.html#once" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>once</span></a>
57<a href="PoolEmitter.html#prependListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>prepend<wbr/>Listener</span></a>
58<a href="PoolEmitter.html#prependOnceListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>prepend<wbr/>Once<wbr/>Listener</span></a>
59<a href="PoolEmitter.html#rawListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>raw<wbr/>Listeners</span></a>
60<a href="PoolEmitter.html#removeAllListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>remove<wbr/>All<wbr/>Listeners</span></a>
61<a href="PoolEmitter.html#removeListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>remove<wbr/>Listener</span></a>
62<a href="PoolEmitter.html#setMaxListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>set<wbr/>Max<wbr/>Listeners</span></a>
63<a href="PoolEmitter.html#getEventListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Event<wbr/>Listeners</span></a>
3c7c9bd1 64<a href="PoolEmitter.html#getMaxListeners-2" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Max<wbr/>Listeners</span></a>
15d6dfaf 65<a href="PoolEmitter.html#listenerCount-2" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>listener<wbr/>Count</span></a>
66<a href="PoolEmitter.html#on-2" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>on</span></a>
67<a href="PoolEmitter.html#once-2" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>once</span></a>
68<a href="PoolEmitter.html#setMaxListeners-2" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>set<wbr/>Max<wbr/>Listeners</span></a>
41015374
JB
69</div></section></div></details></section></section>
70<section class="tsd-panel-group tsd-member-group">
71<h2>Constructors</h2>
3bd6a82e 72<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="constructor" class="tsd-anchor"></a>
15d6dfaf 73<h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" id="icon-anchor"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></svg></a></h3>
3bd6a82e 74<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 75<li class="tsd-signature tsd-anchor-link" id="constructor.new_PoolEmitter"><span class="tsd-kind-constructor-signature">new <wbr/>Pool<wbr/>Emitter</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#constructor.new_PoolEmitter" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
76<li class="tsd-description">
77<div class="tsd-parameters">
78<h4 class="tsd-parameters-title">Parameters</h4>
79<ul class="tsd-parameter-list">
80<li>
3bd6a82e 81<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type ">EventEmitterOptions</span></h5></li></ul></div>
8d1797ad 82<h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4><aside class="tsd-sources">
912e1dfa 83<p>Inherited from EventEmitter.constructor</p>
41015374 84<ul>
3c7c9bd1 85<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:109</li></ul></aside></li></ul></section></section>
41015374
JB
86<section class="tsd-panel-group tsd-member-group">
87<h2>Properties</h2>
3bd6a82e 88<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="captureRejectionSymbol" class="tsd-anchor"></a>
15d6dfaf 89<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>capture<wbr/>Rejection<wbr/>Symbol</span><a href="#captureRejectionSymbol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
811dc01f 90<div class="tsd-signature"><span class="tsd-kind-property">capture<wbr/>Rejection<wbr/>Symbol</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">typeof </span><a href="PoolEmitter.html#captureRejectionSymbol" class="tsd-signature-type tsd-kind-property">captureRejectionSymbol</a></div>
91<div class="tsd-comment tsd-typography"><p>Value: <code>Symbol.for(&#39;nodejs.rejection&#39;)</code></p>
92<p>See how to write a custom <code>rejection handler</code>.</p>
15d6dfaf 93</div>
94<div class="tsd-comment tsd-typography">
95<h4>Since</h4><p>v13.4.0, v12.16.0</p>
811dc01f 96</div><aside class="tsd-sources">
912e1dfa 97<p>Inherited from EventEmitter.captureRejectionSymbol</p>
41015374 98<ul>
3c7c9bd1 99<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:355</li></ul></aside></section>
3bd6a82e 100<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="captureRejections" class="tsd-anchor"></a>
15d6dfaf 101<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>capture<wbr/>Rejections</span><a href="#captureRejections" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
8d1797ad 102<div class="tsd-signature"><span class="tsd-kind-property">capture<wbr/>Rejections</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
811dc01f 103<div class="tsd-comment tsd-typography"><p>Value: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type">boolean</a></p>
104<p>Change the default <code>captureRejections</code> option on all new <code>EventEmitter</code> objects.</p>
15d6dfaf 105</div>
106<div class="tsd-comment tsd-typography">
107<h4>Since</h4><p>v13.4.0, v12.16.0</p>
41015374 108</div><aside class="tsd-sources">
912e1dfa 109<p>Inherited from EventEmitter.captureRejections</p>
41015374 110<ul>
3c7c9bd1 111<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:362</li></ul></aside></section>
3bd6a82e 112<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="defaultMaxListeners" class="tsd-anchor"></a>
15d6dfaf 113<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>default<wbr/>Max<wbr/>Listeners</span><a href="#defaultMaxListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
811dc01f 114<div class="tsd-signature"><span class="tsd-kind-property">default<wbr/>Max<wbr/>Listeners</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
115<div class="tsd-comment tsd-typography"><p>By default, a maximum of <code>10</code> listeners can be registered for any single
116event. This limit can be changed for individual <code>EventEmitter</code> instances
117using the <code>emitter.setMaxListeners(n)</code> method. To change the default
118for <em>all</em><code>EventEmitter</code> instances, the <code>events.defaultMaxListeners</code>property can be used. If this value is not a positive number, a <code>RangeError</code>is thrown.</p>
119<p>Take caution when setting the <code>events.defaultMaxListeners</code> because the
120change affects <em>all</em><code>EventEmitter</code> instances, including those created before
121the change is made. However, calling <code>emitter.setMaxListeners(n)</code> still has
122precedence over <code>events.defaultMaxListeners</code>.</p>
123<p>This is not a hard limit. The <code>EventEmitter</code> instance will allow
124more listeners to be added but will output a trace warning to stderr indicating
125that a &quot;possible EventEmitter memory leak&quot; has been detected. For any single<code>EventEmitter</code>, the <code>emitter.getMaxListeners()</code> and <code>emitter.setMaxListeners()</code>methods can be used to
126temporarily avoid this warning:</p>
127<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">emitter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">setMaxListeners</span><span class="hl-0">(</span><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">getMaxListeners</span><span class="hl-0">() + </span><span class="hl-1">1</span><span class="hl-0">);</span><br/><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-8">// do stuff</span><br/><span class="hl-0"> </span><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">setMaxListeners</span><span class="hl-0">(</span><span class="hl-3">Math</span><span class="hl-0">.</span><span class="hl-2">max</span><span class="hl-0">(</span><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">getMaxListeners</span><span class="hl-0">() - </span><span class="hl-1">1</span><span class="hl-0">, </span><span class="hl-1">0</span><span class="hl-0">));</span><br/><span class="hl-0">});</span>
128</code><button>Copy</button></pre>
129<p>The <code>--trace-warnings</code> command-line flag can be used to display the
130stack trace for such warnings.</p>
131<p>The emitted warning can be inspected with <code>process.on(&#39;warning&#39;)</code> and will
132have the additional <code>emitter</code>, <code>type</code>, and <code>count</code> properties, referring to
133the event emitter instance, the event&#39;s name and the number of attached
134listeners, respectively.
135Its <code>name</code> property is set to <code>&#39;MaxListenersExceededWarning&#39;</code>.</p>
15d6dfaf 136</div>
137<div class="tsd-comment tsd-typography">
138<h4>Since</h4><p>v0.11.2</p>
811dc01f 139</div><aside class="tsd-sources">
912e1dfa 140<p>Inherited from EventEmitter.defaultMaxListeners</p>
41015374 141<ul>
3c7c9bd1 142<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:399</li></ul></aside></section>
3bd6a82e 143<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="errorMonitor" class="tsd-anchor"></a>
15d6dfaf 144<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <code class="tsd-tag ts-flagReadonly">Readonly</code> <span>error<wbr/>Monitor</span><a href="#errorMonitor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
8d1797ad 145<div class="tsd-signature"><span class="tsd-kind-property">error<wbr/>Monitor</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">typeof </span><a href="PoolEmitter.html#errorMonitor" class="tsd-signature-type tsd-kind-property">errorMonitor</a></div>
811dc01f 146<div class="tsd-comment tsd-typography"><p>This symbol shall be used to install a listener for only monitoring <code>&#39;error&#39;</code>events. Listeners installed using this symbol are called before the regular<code>&#39;error&#39;</code> listeners are called.</p>
147<p>Installing a listener using this symbol does not change the behavior once an<code>&#39;error&#39;</code> event is emitted. Therefore, the process will still crash if no
41015374 148regular <code>&#39;error&#39;</code> listener is installed.</p>
15d6dfaf 149</div>
150<div class="tsd-comment tsd-typography">
151<h4>Since</h4><p>v13.6.0, v12.17.0</p>
41015374 152</div><aside class="tsd-sources">
912e1dfa 153<p>Inherited from EventEmitter.errorMonitor</p>
41015374 154<ul>
3c7c9bd1 155<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:348</li></ul></aside></section></section>
41015374
JB
156<section class="tsd-panel-group tsd-member-group">
157<h2>Methods</h2>
3bd6a82e 158<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="addListener" class="tsd-anchor"></a>
15d6dfaf 159<h3 class="tsd-anchor-link"><span>add<wbr/>Listener</span><a href="#addListener" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 160<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 161<li class="tsd-signature tsd-anchor-link" id="addListener.addListener-1"><span class="tsd-kind-call-signature">add<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#addListener.addListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
162<li class="tsd-description">
163<div class="tsd-comment tsd-typography"><p>Alias for <code>emitter.on(eventName, listener)</code>.</p>
41015374
JB
164</div>
165<div class="tsd-parameters">
166<h4 class="tsd-parameters-title">Parameters</h4>
167<ul class="tsd-parameter-list">
168<li>
3bd6a82e 169<h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li>
41015374 170<li>
3bd6a82e 171<h5><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</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></h5>
41015374
JB
172<ul class="tsd-parameters">
173<li class="tsd-parameter-signature">
3bd6a82e 174<ul class="tsd-signatures tsd-is-external">
175<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
41015374
JB
176<li class="tsd-description">
177<div class="tsd-parameters">
178<h4 class="tsd-parameters-title">Parameters</h4>
179<ul class="tsd-parameter-list">
180<li>
3bd6a82e 181<h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
41015374 182<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div>
15d6dfaf 183<h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
184<div class="tsd-comment tsd-typography">
185<h4>Since</h4><p>v0.1.26</p>
186</div><aside class="tsd-sources">
912e1dfa 187<p>Inherited from EventEmitter.addListener</p>
41015374 188<ul>
3c7c9bd1 189<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:419</li></ul></aside></li></ul></section>
3bd6a82e 190<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="emit" class="tsd-anchor"></a>
15d6dfaf 191<h3 class="tsd-anchor-link"><span>emit</span><a href="#emit" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 192<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 193<li class="tsd-signature tsd-anchor-link" id="emit.emit-1"><span class="tsd-kind-call-signature">emit</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span>, <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><a href="#emit.emit-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
194<li class="tsd-description">
195<div class="tsd-comment tsd-typography"><p>Synchronously calls each of the listeners registered for the event named<code>eventName</code>, in the order they were registered, passing the supplied arguments
196to each.</p>
197<p>Returns <code>true</code> if the event had listeners, <code>false</code> otherwise.</p>
2c94c3a5 198<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">myEmitter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-8">// First listener</span><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, </span><span class="hl-4">function</span><span class="hl-0"> </span><span class="hl-2">firstListener</span><span class="hl-0">() {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;Helloooo! first listener&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">});</span><br/><span class="hl-8">// Second listener</span><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, </span><span class="hl-4">function</span><span class="hl-0"> </span><span class="hl-2">secondListener</span><span class="hl-0">(</span><span class="hl-3">arg1</span><span class="hl-0">, </span><span class="hl-3">arg2</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">`event with parameters </span><span class="hl-4">${</span><span class="hl-3">arg1</span><span class="hl-4">}</span><span class="hl-6">, </span><span class="hl-4">${</span><span class="hl-3">arg2</span><span class="hl-4">}</span><span class="hl-6"> in second listener`</span><span class="hl-0">);</span><br/><span class="hl-0">});</span><br/><span class="hl-8">// Third listener</span><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, </span><span class="hl-4">function</span><span class="hl-0"> </span><span class="hl-2">thirdListener</span><span class="hl-0">(...</span><span class="hl-3">args</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">parameters</span><span class="hl-0"> = </span><span class="hl-3">args</span><span class="hl-0">.</span><span class="hl-2">join</span><span class="hl-0">(</span><span class="hl-6">&#39;, &#39;</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">`event with parameters </span><span class="hl-4">${</span><span class="hl-3">parameters</span><span class="hl-4">}</span><span class="hl-6"> in third listener`</span><span class="hl-0">);</span><br/><span class="hl-0">});</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">listeners</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">));</span><br/><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, </span><span class="hl-1">1</span><span class="hl-0">, </span><span class="hl-1">2</span><span class="hl-0">, </span><span class="hl-1">3</span><span class="hl-0">, </span><span class="hl-1">4</span><span class="hl-0">, </span><span class="hl-1">5</span><span class="hl-0">);</span><br/><br/><span class="hl-8">// Prints:</span><br/><span class="hl-8">// [</span><br/><span class="hl-8">// [Function: firstListener],</span><br/><span class="hl-8">// [Function: secondListener],</span><br/><span class="hl-8">// [Function: thirdListener]</span><br/><span class="hl-8">// ]</span><br/><span class="hl-8">// Helloooo! first listener</span><br/><span class="hl-8">// event with parameters 1, 2 in second listener</span><br/><span class="hl-8">// event with parameters 1, 2, 3, 4, 5 in third listener</span>
fab6d3b5 199</code><button>Copy</button></pre>
41015374
JB
200</div>
201<div class="tsd-parameters">
202<h4 class="tsd-parameters-title">Parameters</h4>
203<ul class="tsd-parameter-list">
204<li>
3bd6a82e 205<h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li>
41015374 206<li>
3bd6a82e 207<h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
15d6dfaf 208<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
209<div class="tsd-comment tsd-typography">
210<h4>Since</h4><p>v0.1.26</p>
211</div><aside class="tsd-sources">
912e1dfa 212<p>Inherited from EventEmitter.emit</p>
41015374 213<ul>
3c7c9bd1 214<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:681</li></ul></aside></li></ul></section>
3bd6a82e 215<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="eventNames" class="tsd-anchor"></a>
15d6dfaf 216<h3 class="tsd-anchor-link"><span>event<wbr/>Names</span><a href="#eventNames" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 217<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 218<li class="tsd-signature tsd-anchor-link" id="eventNames.eventNames-1"><span class="tsd-kind-call-signature">event<wbr/>Names</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span><a href="#eventNames.eventNames-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
219<li class="tsd-description">
220<div class="tsd-comment tsd-typography"><p>Returns an array listing the events for which the emitter has registered
221listeners. The values in the array are strings or <code>Symbol</code>s.</p>
2c94c3a5 222<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">myEE</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {});</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;bar&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {});</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">sym</span><span class="hl-0"> = </span><span class="hl-2">Symbol</span><span class="hl-0">(</span><span class="hl-6">&#39;symbol&#39;</span><span class="hl-0">);</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-3">sym</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {});</span><br/><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">eventNames</span><span class="hl-0">());</span><br/><span class="hl-8">// Prints: [ &#39;foo&#39;, &#39;bar&#39;, Symbol(symbol) ]</span>
fab6d3b5 223</code><button>Copy</button></pre>
41015374 224</div>
15d6dfaf 225<h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">(</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span></h4>
226<div class="tsd-comment tsd-typography">
227<h4>Since</h4><p>v6.0.0</p>
228</div><aside class="tsd-sources">
912e1dfa 229<p>Inherited from EventEmitter.eventNames</p>
41015374 230<ul>
3c7c9bd1 231<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:744</li></ul></aside></li></ul></section>
3bd6a82e 232<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="getMaxListeners" class="tsd-anchor"></a>
15d6dfaf 233<h3 class="tsd-anchor-link"><span>get<wbr/>Max<wbr/>Listeners</span><a href="#getMaxListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 234<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 235<li class="tsd-signature tsd-anchor-link" id="getMaxListeners.getMaxListeners-1"><span class="tsd-kind-call-signature">get<wbr/>Max<wbr/>Listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><a href="#getMaxListeners.getMaxListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
236<li class="tsd-description">
237<div class="tsd-comment tsd-typography"><p>Returns the current max listener value for the <code>EventEmitter</code> which is either
8d1797ad 238set by <code>emitter.setMaxListeners(n)</code> or defaults to <a href="PoolEmitter.html#defaultMaxListeners" class="tsd-kind-property">defaultMaxListeners</a>.</p>
41015374 239</div>
15d6dfaf 240<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
241<div class="tsd-comment tsd-typography">
242<h4>Since</h4><p>v1.0.0</p>
243</div><aside class="tsd-sources">
912e1dfa 244<p>Inherited from EventEmitter.getMaxListeners</p>
41015374 245<ul>
3c7c9bd1 246<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:596</li></ul></aside></li></ul></section>
3bd6a82e 247<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="listenerCount" class="tsd-anchor"></a>
15d6dfaf 248<h3 class="tsd-anchor-link"><span>listener<wbr/>Count</span><a href="#listenerCount" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 249<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 250<li class="tsd-signature tsd-anchor-link" id="listenerCount.listenerCount-1"><span class="tsd-kind-call-signature">listener<wbr/>Count</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><a href="#listenerCount.listenerCount-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374 251<li class="tsd-description">
2c94c3a5 252<div class="tsd-comment tsd-typography"><p>Returns the number of listeners listening for the event named <code>eventName</code>.
253If <code>listener</code> is provided, it will return how many times the listener is found
254in the list of the listeners of the event.</p>
41015374
JB
255</div>
256<div class="tsd-parameters">
257<h4 class="tsd-parameters-title">Parameters</h4>
258<ul class="tsd-parameter-list">
259<li>
3bd6a82e 260<h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5>
41015374 261<div class="tsd-comment tsd-typography"><p>The name of the event being listened for</p>
15d6dfaf 262</div>
263<div class="tsd-comment tsd-typography"></div></li>
65ec4e64 264<li>
265<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-type ">Function</span></h5>
266<div class="tsd-comment tsd-typography"><p>The event handler function</p>
15d6dfaf 267</div>
268<div class="tsd-comment tsd-typography"></div></li></ul></div>
269<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
270<div class="tsd-comment tsd-typography">
271<h4>Since</h4><p>v3.2.0</p>
272</div><aside class="tsd-sources">
912e1dfa 273<p>Inherited from EventEmitter.listenerCount</p>
41015374 274<ul>
3c7c9bd1 275<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:690</li></ul></aside></li></ul></section>
3bd6a82e 276<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="listeners" class="tsd-anchor"></a>
15d6dfaf 277<h3 class="tsd-anchor-link"><span>listeners</span><a href="#listeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 278<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 279<li class="tsd-signature tsd-anchor-link" id="listeners.listeners-1"><span class="tsd-kind-call-signature">listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">Function</span><span class="tsd-signature-symbol">[]</span><a href="#listeners.listeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
280<li class="tsd-description">
281<div class="tsd-comment tsd-typography"><p>Returns a copy of the array of listeners for the event named <code>eventName</code>.</p>
2c94c3a5 282<pre><code class="language-js"><span class="hl-3">server</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;connection&#39;</span><span class="hl-0">, (</span><span class="hl-3">stream</span><span class="hl-0">) </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;someone connected!&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">});</span><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-3">util</span><span class="hl-0">.</span><span class="hl-2">inspect</span><span class="hl-0">(</span><span class="hl-3">server</span><span class="hl-0">.</span><span class="hl-2">listeners</span><span class="hl-0">(</span><span class="hl-6">&#39;connection&#39;</span><span class="hl-0">)));</span><br/><span class="hl-8">// Prints: [ [Function] ]</span>
fab6d3b5 283</code><button>Copy</button></pre>
41015374
JB
284</div>
285<div class="tsd-parameters">
286<h4 class="tsd-parameters-title">Parameters</h4>
287<ul class="tsd-parameter-list">
288<li>
3bd6a82e 289<h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li></ul></div>
15d6dfaf 290<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Function</span><span class="tsd-signature-symbol">[]</span></h4>
291<div class="tsd-comment tsd-typography">
292<h4>Since</h4><p>v0.1.26</p>
293</div><aside class="tsd-sources">
912e1dfa 294<p>Inherited from EventEmitter.listeners</p>
41015374 295<ul>
3c7c9bd1 296<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:609</li></ul></aside></li></ul></section>
3bd6a82e 297<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="off" class="tsd-anchor"></a>
15d6dfaf 298<h3 class="tsd-anchor-link"><span>off</span><a href="#off" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 299<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 300<li class="tsd-signature tsd-anchor-link" id="off.off-1"><span class="tsd-kind-call-signature">off</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#off.off-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
301<li class="tsd-description">
302<div class="tsd-comment tsd-typography"><p>Alias for <code>emitter.removeListener()</code>.</p>
41015374
JB
303</div>
304<div class="tsd-parameters">
305<h4 class="tsd-parameters-title">Parameters</h4>
306<ul class="tsd-parameter-list">
307<li>
3bd6a82e 308<h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li>
41015374 309<li>
3bd6a82e 310<h5><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</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></h5>
41015374
JB
311<ul class="tsd-parameters">
312<li class="tsd-parameter-signature">
3bd6a82e 313<ul class="tsd-signatures tsd-is-external">
314<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
41015374
JB
315<li class="tsd-description">
316<div class="tsd-parameters">
317<h4 class="tsd-parameters-title">Parameters</h4>
318<ul class="tsd-parameter-list">
319<li>
3bd6a82e 320<h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
41015374 321<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div>
15d6dfaf 322<h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
323<div class="tsd-comment tsd-typography">
324<h4>Since</h4><p>v10.0.0</p>
325</div><aside class="tsd-sources">
912e1dfa 326<p>Inherited from EventEmitter.off</p>
41015374 327<ul>
3c7c9bd1 328<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:569</li></ul></aside></li></ul></section>
3bd6a82e 329<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="on" class="tsd-anchor"></a>
15d6dfaf 330<h3 class="tsd-anchor-link"><span>on</span><a href="#on" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 331<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 332<li class="tsd-signature tsd-anchor-link" id="on.on-1"><span class="tsd-kind-call-signature">on</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#on.on-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
333<li class="tsd-description">
334<div class="tsd-comment tsd-typography"><p>Adds the <code>listener</code> function to the end of the listeners array for the
335event named <code>eventName</code>. No checks are made to see if the <code>listener</code> has
336already been added. Multiple calls passing the same combination of <code>eventName</code>and <code>listener</code> will result in the <code>listener</code> being added, and called, multiple
337times.</p>
842d8918 338<pre><code class="language-js"><span class="hl-3">server</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;connection&#39;</span><span class="hl-0">, (</span><span class="hl-3">stream</span><span class="hl-0">) </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;someone connected!&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">});</span>
fab6d3b5 339</code><button>Copy</button></pre>
41015374
JB
340<p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
341<p>By default, event listeners are invoked in the order they are added. The<code>emitter.prependListener()</code> method can be used as an alternative to add the
342event listener to the beginning of the listeners array.</p>
2c94c3a5 343<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">myEE</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;a&#39;</span><span class="hl-0">));</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">prependListener</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;b&#39;</span><span class="hl-0">));</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">);</span><br/><span class="hl-8">// Prints:</span><br/><span class="hl-8">// b</span><br/><span class="hl-8">// a</span>
fab6d3b5 344</code><button>Copy</button></pre>
41015374
JB
345</div>
346<div class="tsd-parameters">
347<h4 class="tsd-parameters-title">Parameters</h4>
348<ul class="tsd-parameter-list">
349<li>
3bd6a82e 350<h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5>
41015374 351<div class="tsd-comment tsd-typography"><p>The name of the event.</p>
15d6dfaf 352</div>
353<div class="tsd-comment tsd-typography"></div></li>
41015374 354<li>
3bd6a82e 355<h5><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</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></h5>
41015374
JB
356<div class="tsd-comment tsd-typography"><p>The callback function</p>
357</div>
15d6dfaf 358<div class="tsd-comment tsd-typography"></div>
41015374
JB
359<ul class="tsd-parameters">
360<li class="tsd-parameter-signature">
3bd6a82e 361<ul class="tsd-signatures tsd-is-external">
362<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
41015374
JB
363<li class="tsd-description">
364<div class="tsd-parameters">
365<h4 class="tsd-parameters-title">Parameters</h4>
366<ul class="tsd-parameter-list">
367<li>
3bd6a82e 368<h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
41015374 369<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div>
15d6dfaf 370<h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
371<div class="tsd-comment tsd-typography">
372<h4>Since</h4><p>v0.1.101</p>
373</div><aside class="tsd-sources">
912e1dfa 374<p>Inherited from EventEmitter.on</p>
41015374 375<ul>
3c7c9bd1 376<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:451</li></ul></aside></li></ul></section>
3bd6a82e 377<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="once" class="tsd-anchor"></a>
15d6dfaf 378<h3 class="tsd-anchor-link"><span>once</span><a href="#once" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 379<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 380<li class="tsd-signature tsd-anchor-link" id="once.once-1"><span class="tsd-kind-call-signature">once</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#once.once-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
381<li class="tsd-description">
382<div class="tsd-comment tsd-typography"><p>Adds a <strong>one-time</strong><code>listener</code> function for the event named <code>eventName</code>. The
383next time <code>eventName</code> is triggered, this listener is removed and then invoked.</p>
842d8918 384<pre><code class="language-js"><span class="hl-3">server</span><span class="hl-0">.</span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-6">&#39;connection&#39;</span><span class="hl-0">, (</span><span class="hl-3">stream</span><span class="hl-0">) </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;Ah, we have our first user!&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">});</span>
fab6d3b5 385</code><button>Copy</button></pre>
41015374
JB
386<p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
387<p>By default, event listeners are invoked in the order they are added. The<code>emitter.prependOnceListener()</code> method can be used as an alternative to add the
388event listener to the beginning of the listeners array.</p>
2c94c3a5 389<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">myEE</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;a&#39;</span><span class="hl-0">));</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">prependOnceListener</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;b&#39;</span><span class="hl-0">));</span><br/><span class="hl-3">myEE</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">);</span><br/><span class="hl-8">// Prints:</span><br/><span class="hl-8">// b</span><br/><span class="hl-8">// a</span>
fab6d3b5 390</code><button>Copy</button></pre>
41015374
JB
391</div>
392<div class="tsd-parameters">
393<h4 class="tsd-parameters-title">Parameters</h4>
394<ul class="tsd-parameter-list">
395<li>
3bd6a82e 396<h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5>
41015374 397<div class="tsd-comment tsd-typography"><p>The name of the event.</p>
15d6dfaf 398</div>
399<div class="tsd-comment tsd-typography"></div></li>
41015374 400<li>
3bd6a82e 401<h5><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</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></h5>
41015374
JB
402<div class="tsd-comment tsd-typography"><p>The callback function</p>
403</div>
15d6dfaf 404<div class="tsd-comment tsd-typography"></div>
41015374
JB
405<ul class="tsd-parameters">
406<li class="tsd-parameter-signature">
3bd6a82e 407<ul class="tsd-signatures tsd-is-external">
408<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
41015374
JB
409<li class="tsd-description">
410<div class="tsd-parameters">
411<h4 class="tsd-parameters-title">Parameters</h4>
412<ul class="tsd-parameter-list">
413<li>
3bd6a82e 414<h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
41015374 415<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div>
15d6dfaf 416<h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
417<div class="tsd-comment tsd-typography">
418<h4>Since</h4><p>v0.3.0</p>
419</div><aside class="tsd-sources">
912e1dfa 420<p>Inherited from EventEmitter.once</p>
41015374 421<ul>
3c7c9bd1 422<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:481</li></ul></aside></li></ul></section>
3bd6a82e 423<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="prependListener" class="tsd-anchor"></a>
15d6dfaf 424<h3 class="tsd-anchor-link"><span>prepend<wbr/>Listener</span><a href="#prependListener" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 425<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 426<li class="tsd-signature tsd-anchor-link" id="prependListener.prependListener-1"><span class="tsd-kind-call-signature">prepend<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#prependListener.prependListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
427<li class="tsd-description">
428<div class="tsd-comment tsd-typography"><p>Adds the <code>listener</code> function to the <em>beginning</em> of the listeners array for the
429event named <code>eventName</code>. No checks are made to see if the <code>listener</code> has
430already been added. Multiple calls passing the same combination of <code>eventName</code>and <code>listener</code> will result in the <code>listener</code> being added, and called, multiple
431times.</p>
842d8918 432<pre><code class="language-js"><span class="hl-3">server</span><span class="hl-0">.</span><span class="hl-2">prependListener</span><span class="hl-0">(</span><span class="hl-6">&#39;connection&#39;</span><span class="hl-0">, (</span><span class="hl-3">stream</span><span class="hl-0">) </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;someone connected!&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">});</span>
fab6d3b5 433</code><button>Copy</button></pre>
41015374 434<p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
41015374
JB
435</div>
436<div class="tsd-parameters">
437<h4 class="tsd-parameters-title">Parameters</h4>
438<ul class="tsd-parameter-list">
439<li>
3bd6a82e 440<h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5>
41015374 441<div class="tsd-comment tsd-typography"><p>The name of the event.</p>
15d6dfaf 442</div>
443<div class="tsd-comment tsd-typography"></div></li>
41015374 444<li>
3bd6a82e 445<h5><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</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></h5>
41015374
JB
446<div class="tsd-comment tsd-typography"><p>The callback function</p>
447</div>
15d6dfaf 448<div class="tsd-comment tsd-typography"></div>
41015374
JB
449<ul class="tsd-parameters">
450<li class="tsd-parameter-signature">
3bd6a82e 451<ul class="tsd-signatures tsd-is-external">
452<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
41015374
JB
453<li class="tsd-description">
454<div class="tsd-parameters">
455<h4 class="tsd-parameters-title">Parameters</h4>
456<ul class="tsd-parameter-list">
457<li>
3bd6a82e 458<h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
41015374 459<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div>
15d6dfaf 460<h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
461<div class="tsd-comment tsd-typography">
462<h4>Since</h4><p>v6.0.0</p>
463</div><aside class="tsd-sources">
912e1dfa 464<p>Inherited from EventEmitter.prependListener</p>
41015374 465<ul>
3c7c9bd1 466<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:708</li></ul></aside></li></ul></section>
3bd6a82e 467<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="prependOnceListener" class="tsd-anchor"></a>
15d6dfaf 468<h3 class="tsd-anchor-link"><span>prepend<wbr/>Once<wbr/>Listener</span><a href="#prependOnceListener" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 469<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 470<li class="tsd-signature tsd-anchor-link" id="prependOnceListener.prependOnceListener-1"><span class="tsd-kind-call-signature">prepend<wbr/>Once<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#prependOnceListener.prependOnceListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
471<li class="tsd-description">
472<div class="tsd-comment tsd-typography"><p>Adds a <strong>one-time</strong><code>listener</code> function for the event named <code>eventName</code> to the <em>beginning</em> of the listeners array. The next time <code>eventName</code> is triggered, this
473listener is removed, and then invoked.</p>
842d8918 474<pre><code class="language-js"><span class="hl-3">server</span><span class="hl-0">.</span><span class="hl-2">prependOnceListener</span><span class="hl-0">(</span><span class="hl-6">&#39;connection&#39;</span><span class="hl-0">, (</span><span class="hl-3">stream</span><span class="hl-0">) </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;Ah, we have our first user!&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">});</span>
fab6d3b5 475</code><button>Copy</button></pre>
41015374 476<p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
41015374
JB
477</div>
478<div class="tsd-parameters">
479<h4 class="tsd-parameters-title">Parameters</h4>
480<ul class="tsd-parameter-list">
481<li>
3bd6a82e 482<h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5>
41015374 483<div class="tsd-comment tsd-typography"><p>The name of the event.</p>
15d6dfaf 484</div>
485<div class="tsd-comment tsd-typography"></div></li>
41015374 486<li>
3bd6a82e 487<h5><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</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></h5>
41015374
JB
488<div class="tsd-comment tsd-typography"><p>The callback function</p>
489</div>
15d6dfaf 490<div class="tsd-comment tsd-typography"></div>
41015374
JB
491<ul class="tsd-parameters">
492<li class="tsd-parameter-signature">
3bd6a82e 493<ul class="tsd-signatures tsd-is-external">
494<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
41015374
JB
495<li class="tsd-description">
496<div class="tsd-parameters">
497<h4 class="tsd-parameters-title">Parameters</h4>
498<ul class="tsd-parameter-list">
499<li>
3bd6a82e 500<h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
41015374 501<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div>
15d6dfaf 502<h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
503<div class="tsd-comment tsd-typography">
504<h4>Since</h4><p>v6.0.0</p>
505</div><aside class="tsd-sources">
912e1dfa 506<p>Inherited from EventEmitter.prependOnceListener</p>
41015374 507<ul>
3c7c9bd1 508<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:724</li></ul></aside></li></ul></section>
3bd6a82e 509<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="rawListeners" class="tsd-anchor"></a>
15d6dfaf 510<h3 class="tsd-anchor-link"><span>raw<wbr/>Listeners</span><a href="#rawListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 511<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 512<li class="tsd-signature tsd-anchor-link" id="rawListeners.rawListeners-1"><span class="tsd-kind-call-signature">raw<wbr/>Listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">Function</span><span class="tsd-signature-symbol">[]</span><a href="#rawListeners.rawListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
513<li class="tsd-description">
514<div class="tsd-comment tsd-typography"><p>Returns a copy of the array of listeners for the event named <code>eventName</code>,
515including any wrappers (such as those created by <code>.once()</code>).</p>
2c94c3a5 516<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">emitter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-6">&#39;log&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;log once&#39;</span><span class="hl-0">));</span><br/><br/><span class="hl-8">// Returns a new Array with a function `onceWrapper` which has a property</span><br/><span class="hl-8">// `listener` which contains the original listener bound above</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">listeners</span><span class="hl-0"> = </span><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">rawListeners</span><span class="hl-0">(</span><span class="hl-6">&#39;log&#39;</span><span class="hl-0">);</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">logFnWrapper</span><span class="hl-0"> = </span><span class="hl-3">listeners</span><span class="hl-0">[</span><span class="hl-1">0</span><span class="hl-0">];</span><br/><br/><span class="hl-8">// Logs &quot;log once&quot; to the console and does not unbind the `once` event</span><br/><span class="hl-3">logFnWrapper</span><span class="hl-0">.</span><span class="hl-2">listener</span><span class="hl-0">();</span><br/><br/><span class="hl-8">// Logs &quot;log once&quot; to the console and removes the listener</span><br/><span class="hl-2">logFnWrapper</span><span class="hl-0">();</span><br/><br/><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;log&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;log persistently&#39;</span><span class="hl-0">));</span><br/><span class="hl-8">// Will return a new Array with a single function bound by `.on()` above</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">newListeners</span><span class="hl-0"> = </span><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">rawListeners</span><span class="hl-0">(</span><span class="hl-6">&#39;log&#39;</span><span class="hl-0">);</span><br/><br/><span class="hl-8">// Logs &quot;log persistently&quot; twice</span><br/><span class="hl-3">newListeners</span><span class="hl-0">[</span><span class="hl-1">0</span><span class="hl-0">]();</span><br/><span class="hl-3">emitter</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;log&#39;</span><span class="hl-0">);</span>
fab6d3b5 517</code><button>Copy</button></pre>
41015374
JB
518</div>
519<div class="tsd-parameters">
520<h4 class="tsd-parameters-title">Parameters</h4>
521<ul class="tsd-parameter-list">
522<li>
3bd6a82e 523<h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li></ul></div>
15d6dfaf 524<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Function</span><span class="tsd-signature-symbol">[]</span></h4>
525<div class="tsd-comment tsd-typography">
526<h4>Since</h4><p>v9.4.0</p>
527</div><aside class="tsd-sources">
912e1dfa 528<p>Inherited from EventEmitter.rawListeners</p>
41015374 529<ul>
3c7c9bd1 530<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:640</li></ul></aside></li></ul></section>
3bd6a82e 531<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="removeAllListeners" class="tsd-anchor"></a>
15d6dfaf 532<h3 class="tsd-anchor-link"><span>remove<wbr/>All<wbr/>Listeners</span><a href="#removeAllListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 533<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 534<li class="tsd-signature tsd-anchor-link" id="removeAllListeners.removeAllListeners-1"><span class="tsd-kind-call-signature">remove<wbr/>All<wbr/>Listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#removeAllListeners.removeAllListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
535<li class="tsd-description">
536<div class="tsd-comment tsd-typography"><p>Removes all listeners, or those of the specified <code>eventName</code>.</p>
537<p>It is bad practice to remove listeners added elsewhere in the code,
538particularly when the <code>EventEmitter</code> instance was created by some other
539component or module (e.g. sockets or file streams).</p>
540<p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
41015374
JB
541</div>
542<div class="tsd-parameters">
543<h4 class="tsd-parameters-title">Parameters</h4>
544<ul class="tsd-parameter-list">
545<li>
3bd6a82e 546<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li></ul></div>
15d6dfaf 547<h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
548<div class="tsd-comment tsd-typography">
549<h4>Since</h4><p>v0.1.26</p>
550</div><aside class="tsd-sources">
912e1dfa 551<p>Inherited from EventEmitter.removeAllListeners</p>
41015374 552<ul>
3c7c9bd1 553<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:580</li></ul></aside></li></ul></section>
3bd6a82e 554<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="removeListener" class="tsd-anchor"></a>
15d6dfaf 555<h3 class="tsd-anchor-link"><span>remove<wbr/>Listener</span><a href="#removeListener" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 556<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 557<li class="tsd-signature tsd-anchor-link" id="removeListener.removeListener-1"><span class="tsd-kind-call-signature">remove<wbr/>Listener</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">listener</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#removeListener.removeListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
558<li class="tsd-description">
559<div class="tsd-comment tsd-typography"><p>Removes the specified <code>listener</code> from the listener array for the event named<code>eventName</code>.</p>
2c94c3a5 560<pre><code class="language-js"><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-2">callback</span><span class="hl-0"> = (</span><span class="hl-3">stream</span><span class="hl-0">) </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;someone connected!&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">};</span><br/><span class="hl-3">server</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;connection&#39;</span><span class="hl-0">, </span><span class="hl-3">callback</span><span class="hl-0">);</span><br/><span class="hl-8">// ...</span><br/><span class="hl-3">server</span><span class="hl-0">.</span><span class="hl-2">removeListener</span><span class="hl-0">(</span><span class="hl-6">&#39;connection&#39;</span><span class="hl-0">, </span><span class="hl-3">callback</span><span class="hl-0">);</span>
fab6d3b5 561</code><button>Copy</button></pre>
41015374
JB
562<p><code>removeListener()</code> will remove, at most, one instance of a listener from the
563listener array. If any single listener has been added multiple times to the
564listener array for the specified <code>eventName</code>, then <code>removeListener()</code> must be
565called multiple times to remove each instance.</p>
566<p>Once an event is emitted, all listeners attached to it at the
567time of emitting are called in order. This implies that any<code>removeListener()</code> or <code>removeAllListeners()</code> calls <em>after</em> emitting and <em>before</em> the last listener finishes execution
568will not remove them from<code>emit()</code> in progress. Subsequent events behave as expected.</p>
2c94c3a5 569<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-4">class</span><span class="hl-0"> </span><span class="hl-9">MyEmitter</span><span class="hl-0"> </span><span class="hl-4">extends</span><span class="hl-0"> </span><span class="hl-9">EventEmitter</span><span class="hl-0"> {}</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">myEmitter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">MyEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-2">callbackA</span><span class="hl-0"> = () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;A&#39;</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">removeListener</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, </span><span class="hl-3">callbackB</span><span class="hl-0">);</span><br/><span class="hl-0">};</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-2">callbackB</span><span class="hl-0"> = () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;B&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">};</span><br/><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, </span><span class="hl-3">callbackA</span><span class="hl-0">);</span><br/><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, </span><span class="hl-3">callbackB</span><span class="hl-0">);</span><br/><br/><span class="hl-8">// callbackA removes listener callbackB but it will still be called.</span><br/><span class="hl-8">// Internal listener array at time of emit [callbackA, callbackB]</span><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">);</span><br/><span class="hl-8">// Prints:</span><br/><span class="hl-8">// A</span><br/><span class="hl-8">// B</span><br/><br/><span class="hl-8">// callbackB is now removed.</span><br/><span class="hl-8">// Internal listener array [callbackA]</span><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">);</span><br/><span class="hl-8">// Prints:</span><br/><span class="hl-8">// A</span>
fab6d3b5 570</code><button>Copy</button></pre>
41015374
JB
571<p>Because listeners are managed using an internal array, calling this will
572change the position indices of any listener registered <em>after</em> the listener
573being removed. This will not impact the order in which listeners are called,
574but it means that any copies of the listener array as returned by
575the <code>emitter.listeners()</code> method will need to be recreated.</p>
576<p>When a single function has been added as a handler multiple times for a single
577event (as in the example below), <code>removeListener()</code> will remove the most
578recently added instance. In the example the <code>once(&#39;ping&#39;)</code>listener is removed:</p>
2c94c3a5 579<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ee</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-4">function</span><span class="hl-0"> </span><span class="hl-2">pong</span><span class="hl-0">() {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;pong&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">}</span><br/><br/><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;ping&#39;</span><span class="hl-0">, </span><span class="hl-3">pong</span><span class="hl-0">);</span><br/><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-6">&#39;ping&#39;</span><span class="hl-0">, </span><span class="hl-3">pong</span><span class="hl-0">);</span><br/><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">removeListener</span><span class="hl-0">(</span><span class="hl-6">&#39;ping&#39;</span><span class="hl-0">, </span><span class="hl-3">pong</span><span class="hl-0">);</span><br/><br/><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;ping&#39;</span><span class="hl-0">);</span><br/><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;ping&#39;</span><span class="hl-0">);</span>
fab6d3b5 580</code><button>Copy</button></pre>
41015374 581<p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
41015374
JB
582</div>
583<div class="tsd-parameters">
584<h4 class="tsd-parameters-title">Parameters</h4>
585<ul class="tsd-parameter-list">
586<li>
3bd6a82e 587<h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li>
41015374 588<li>
3bd6a82e 589<h5><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</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></h5>
41015374
JB
590<ul class="tsd-parameters">
591<li class="tsd-parameter-signature">
3bd6a82e 592<ul class="tsd-signatures tsd-is-external">
593<li class="tsd-signature"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
41015374
JB
594<li class="tsd-description">
595<div class="tsd-parameters">
596<h4 class="tsd-parameters-title">Parameters</h4>
597<ul class="tsd-parameter-list">
598<li>
3bd6a82e 599<h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
41015374 600<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div>
15d6dfaf 601<h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
602<div class="tsd-comment tsd-typography">
603<h4>Since</h4><p>v0.1.26</p>
604</div><aside class="tsd-sources">
912e1dfa 605<p>Inherited from EventEmitter.removeListener</p>
41015374 606<ul>
3c7c9bd1 607<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:564</li></ul></aside></li></ul></section>
3bd6a82e 608<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="setMaxListeners" class="tsd-anchor"></a>
15d6dfaf 609<h3 class="tsd-anchor-link"><span>set<wbr/>Max<wbr/>Listeners</span><a href="#setMaxListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 610<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 611<li class="tsd-signature tsd-anchor-link" id="setMaxListeners.setMaxListeners-1"><span class="tsd-kind-call-signature">set<wbr/>Max<wbr/>Listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">n</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a><a href="#setMaxListeners.setMaxListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
612<li class="tsd-description">
613<div class="tsd-comment tsd-typography"><p>By default <code>EventEmitter</code>s will print a warning if more than <code>10</code> listeners are
614added for a particular event. This is a useful default that helps finding
615memory leaks. The <code>emitter.setMaxListeners()</code> method allows the limit to be
616modified for this specific <code>EventEmitter</code> instance. The value can be set to<code>Infinity</code> (or <code>0</code>) to indicate an unlimited number of listeners.</p>
617<p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>
41015374
JB
618</div>
619<div class="tsd-parameters">
620<h4 class="tsd-parameters-title">Parameters</h4>
621<ul class="tsd-parameter-list">
622<li>
3bd6a82e 623<h5><span class="tsd-kind-parameter">n</span>: <span class="tsd-signature-type">number</span></h5></li></ul></div>
15d6dfaf 624<h4 class="tsd-returns-title">Returns <a href="PoolEmitter.html" class="tsd-signature-type tsd-kind-class">PoolEmitter</a></h4>
625<div class="tsd-comment tsd-typography">
626<h4>Since</h4><p>v0.3.5</p>
627</div><aside class="tsd-sources">
912e1dfa 628<p>Inherited from EventEmitter.setMaxListeners</p>
41015374 629<ul>
3c7c9bd1 630<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:590</li></ul></aside></li></ul></section>
3bd6a82e 631<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="getEventListeners" class="tsd-anchor"></a>
15d6dfaf 632<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>get<wbr/>Event<wbr/>Listeners</span><a href="#getEventListeners" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 633<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 634<li class="tsd-signature tsd-anchor-link" id="getEventListeners.getEventListeners-1"><span class="tsd-kind-call-signature">get<wbr/>Event<wbr/>Listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span>, <span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">Function</span><span class="tsd-signature-symbol">[]</span><a href="#getEventListeners.getEventListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
635<li class="tsd-description">
636<div class="tsd-comment tsd-typography"><p>Returns a copy of the array of listeners for the event named <code>eventName</code>.</p>
637<p>For <code>EventEmitter</code>s this behaves exactly the same as calling <code>.listeners</code> on
638the emitter.</p>
639<p>For <code>EventTarget</code>s this is the only way to get the event listeners for the
640event target. This is useful for debugging and diagnostic purposes.</p>
2c94c3a5 641<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">getEventListeners</span><span class="hl-0">, </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-0">{</span><br/><span class="hl-0"> </span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ee</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-0"> </span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-2">listener</span><span class="hl-0"> = () </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;Events are fun&#39;</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, </span><span class="hl-3">listener</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-2">getEventListeners</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">, </span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">)); </span><span class="hl-8">// [ [Function: listener] ]</span><br/><span class="hl-0">}</span><br/><span class="hl-0">{</span><br/><span class="hl-0"> </span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">et</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventTarget</span><span class="hl-0">();</span><br/><span class="hl-0"> </span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-2">listener</span><span class="hl-0"> = () </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;Events are fun&#39;</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">et</span><span class="hl-0">.</span><span class="hl-2">addEventListener</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, </span><span class="hl-3">listener</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-2">getEventListeners</span><span class="hl-0">(</span><span class="hl-3">et</span><span class="hl-0">, </span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">)); </span><span class="hl-8">// [ [Function: listener] ]</span><br/><span class="hl-0">}</span>
fab6d3b5 642</code><button>Copy</button></pre>
41015374
JB
643</div>
644<div class="tsd-parameters">
645<h4 class="tsd-parameters-title">Parameters</h4>
646<ul class="tsd-parameter-list">
647<li>
3bd6a82e 648<h5><span class="tsd-kind-parameter">emitter</span>: <span class="tsd-signature-type ">EventEmitter</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">_DOMEventTarget</span></h5></li>
41015374 649<li>
3bd6a82e 650<h5><span class="tsd-kind-parameter">name</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li></ul></div>
15d6dfaf 651<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">Function</span><span class="tsd-signature-symbol">[]</span></h4>
652<div class="tsd-comment tsd-typography">
653<h4>Since</h4><p>v15.2.0, v14.17.0</p>
654</div><aside class="tsd-sources">
912e1dfa 655<p>Inherited from EventEmitter.getEventListeners</p>
41015374 656<ul>
3c7c9bd1 657<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:296</li></ul></aside></li></ul></section>
658<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="getMaxListeners-2" class="tsd-anchor"></a>
659<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>get<wbr/>Max<wbr/>Listeners</span><a href="#getMaxListeners-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
660<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
661<li class="tsd-signature tsd-anchor-link" id="getMaxListeners-2.getMaxListeners-3"><span class="tsd-kind-call-signature">get<wbr/>Max<wbr/>Listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><a href="#getMaxListeners-2.getMaxListeners-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
662<li class="tsd-description">
663<div class="tsd-comment tsd-typography"><p>Returns the currently set max amount of listeners.</p>
664<p>For <code>EventEmitter</code>s this behaves exactly the same as calling <code>.getMaxListeners</code> on
665the emitter.</p>
666<p>For <code>EventTarget</code>s this is the only way to get the max event listeners for the
667event target. If the number of event handlers on a single EventTarget exceeds
668the max set, the EventTarget will print a warning.</p>
669<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">getMaxListeners</span><span class="hl-0">, </span><span class="hl-3">setMaxListeners</span><span class="hl-0">, </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-0">{</span><br/><span class="hl-0"> </span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ee</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-2">getMaxListeners</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">)); </span><span class="hl-8">// 10</span><br/><span class="hl-0"> </span><span class="hl-2">setMaxListeners</span><span class="hl-0">(</span><span class="hl-1">11</span><span class="hl-0">, </span><span class="hl-3">ee</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-2">getMaxListeners</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">)); </span><span class="hl-8">// 11</span><br/><span class="hl-0">}</span><br/><span class="hl-0">{</span><br/><span class="hl-0"> </span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">et</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventTarget</span><span class="hl-0">();</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-2">getMaxListeners</span><span class="hl-0">(</span><span class="hl-3">et</span><span class="hl-0">)); </span><span class="hl-8">// 10</span><br/><span class="hl-0"> </span><span class="hl-2">setMaxListeners</span><span class="hl-0">(</span><span class="hl-1">11</span><span class="hl-0">, </span><span class="hl-3">et</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-2">getMaxListeners</span><span class="hl-0">(</span><span class="hl-3">et</span><span class="hl-0">)); </span><span class="hl-8">// 11</span><br/><span class="hl-0">}</span>
670</code><button>Copy</button></pre>
671</div>
672<div class="tsd-parameters">
673<h4 class="tsd-parameters-title">Parameters</h4>
674<ul class="tsd-parameter-list">
675<li>
676<h5><span class="tsd-kind-parameter">emitter</span>: <span class="tsd-signature-type ">EventEmitter</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">_DOMEventTarget</span></h5></li></ul></div>
677<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
678<div class="tsd-comment tsd-typography">
679<h4>Since</h4><p>v19.9.0</p>
680</div><aside class="tsd-sources">
681<p>Inherited from EventEmitter.getMaxListeners</p>
682<ul>
683<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:325</li></ul></aside></li></ul></section>
3bd6a82e 684<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="listenerCount-2" class="tsd-anchor"></a>
15d6dfaf 685<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>listener<wbr/>Count</span><a href="#listenerCount-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 686<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 687<li class="tsd-signature tsd-anchor-link" id="listenerCount-2.listenerCount-3"><span class="tsd-kind-call-signature">listener<wbr/>Count</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span>, <span class="tsd-kind-parameter">eventName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><a href="#listenerCount-2.listenerCount-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
688<li class="tsd-description">
689<div class="tsd-comment tsd-typography"><p>A class method that returns the number of listeners for the given <code>eventName</code>registered on the given <code>emitter</code>.</p>
2c94c3a5 690<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0">, </span><span class="hl-3">listenerCount</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">myEmitter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {});</span><br/><span class="hl-3">myEmitter</span><span class="hl-0">.</span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">, () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {});</span><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-2">listenerCount</span><span class="hl-0">(</span><span class="hl-3">myEmitter</span><span class="hl-0">, </span><span class="hl-6">&#39;event&#39;</span><span class="hl-0">));</span><br/><span class="hl-8">// Prints: 2</span>
fab6d3b5 691</code><button>Copy</button></pre>
41015374
JB
692</div>
693<div class="tsd-parameters">
694<h4 class="tsd-parameters-title">Parameters</h4>
695<ul class="tsd-parameter-list">
696<li>
3bd6a82e 697<h5><span class="tsd-kind-parameter">emitter</span>: <span class="tsd-signature-type ">EventEmitter</span></h5>
41015374 698<div class="tsd-comment tsd-typography"><p>The emitter to query</p>
15d6dfaf 699</div>
700<div class="tsd-comment tsd-typography"></div></li>
41015374 701<li>
3bd6a82e 702<h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5>
41015374 703<div class="tsd-comment tsd-typography"><p>The event name</p>
15d6dfaf 704</div>
705<div class="tsd-comment tsd-typography"></div></li></ul></div>
706<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4>
707<div class="tsd-comment tsd-typography">
708<h4>Since</h4><p>v0.9.12</p>
709
710<h4>Deprecated</h4><p>Since v3.2.0 - Use <code>listenerCount</code> instead.</p>
711</div><aside class="tsd-sources">
912e1dfa 712<p>Inherited from EventEmitter.listenerCount</p>
41015374 713<ul>
3c7c9bd1 714<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:268</li></ul></aside></li></ul></section>
3bd6a82e 715<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="on-2" class="tsd-anchor"></a>
15d6dfaf 716<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>on</span><a href="#on-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 717<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 718<li class="tsd-signature tsd-anchor-link" id="on-2.on-3"><span class="tsd-kind-call-signature">on</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span>, <span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">AsyncIterableIterator</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><a href="#on-2.on-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374 719<li class="tsd-description">
2c94c3a5 720<div class="tsd-comment tsd-typography"><pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">on</span><span class="hl-0">, </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-5">import</span><span class="hl-0"> </span><span class="hl-3">process</span><span class="hl-0"> </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:process&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ee</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-8">// Emit later on</span><br/><span class="hl-3">process</span><span class="hl-0">.</span><span class="hl-2">nextTick</span><span class="hl-0">(() </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, </span><span class="hl-6">&#39;bar&#39;</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, </span><span class="hl-1">42</span><span class="hl-0">);</span><br/><span class="hl-0">});</span><br/><br/><span class="hl-5">for</span><span class="hl-0"> </span><span class="hl-5">await</span><span class="hl-0"> (</span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">event</span><span class="hl-0"> </span><span class="hl-4">of</span><span class="hl-0"> </span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">, </span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">)) {</span><br/><span class="hl-0"> </span><span class="hl-8">// The execution of this inner block is synchronous and it</span><br/><span class="hl-0"> </span><span class="hl-8">// processes one event at a time (even with await). Do not use</span><br/><span class="hl-0"> </span><span class="hl-8">// if concurrent execution is required.</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-3">event</span><span class="hl-0">); </span><span class="hl-8">// prints [&#39;bar&#39;] [42]</span><br/><span class="hl-0">}</span><br/><span class="hl-8">// Unreachable here</span>
fab6d3b5 721</code><button>Copy</button></pre>
41015374
JB
722<p>Returns an <code>AsyncIterator</code> that iterates <code>eventName</code> events. It will throw
723if the <code>EventEmitter</code> emits <code>&#39;error&#39;</code>. It removes all listeners when
724exiting the loop. The <code>value</code> returned by each iteration is an array
725composed of the emitted event arguments.</p>
726<p>An <code>AbortSignal</code> can be used to cancel waiting on events:</p>
2c94c3a5 727<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">on</span><span class="hl-0">, </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-5">import</span><span class="hl-0"> </span><span class="hl-3">process</span><span class="hl-0"> </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:process&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ac</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">AbortController</span><span class="hl-0">();</span><br/><br/><span class="hl-0">(</span><span class="hl-4">async</span><span class="hl-0"> () </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ee</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-0"> </span><span class="hl-8">// Emit later on</span><br/><span class="hl-0"> </span><span class="hl-3">process</span><span class="hl-0">.</span><span class="hl-2">nextTick</span><span class="hl-0">(() </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, </span><span class="hl-6">&#39;bar&#39;</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, </span><span class="hl-1">42</span><span class="hl-0">);</span><br/><span class="hl-0"> });</span><br/><br/><span class="hl-0"> </span><span class="hl-5">for</span><span class="hl-0"> </span><span class="hl-5">await</span><span class="hl-0"> (</span><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">event</span><span class="hl-0"> </span><span class="hl-4">of</span><span class="hl-0"> </span><span class="hl-2">on</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">, </span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, { </span><span class="hl-3">signal:</span><span class="hl-0"> </span><span class="hl-3">ac</span><span class="hl-0">.</span><span class="hl-3">signal</span><span class="hl-0"> })) {</span><br/><span class="hl-0"> </span><span class="hl-8">// The execution of this inner block is synchronous and it</span><br/><span class="hl-0"> </span><span class="hl-8">// processes one event at a time (even with await). Do not use</span><br/><span class="hl-0"> </span><span class="hl-8">// if concurrent execution is required.</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-3">event</span><span class="hl-0">); </span><span class="hl-8">// prints [&#39;bar&#39;] [42]</span><br/><span class="hl-0"> }</span><br/><span class="hl-0"> </span><span class="hl-8">// Unreachable here</span><br/><span class="hl-0">})();</span><br/><br/><span class="hl-3">process</span><span class="hl-0">.</span><span class="hl-2">nextTick</span><span class="hl-0">(() </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">ac</span><span class="hl-0">.</span><span class="hl-2">abort</span><span class="hl-0">());</span>
fab6d3b5 728</code><button>Copy</button></pre>
41015374
JB
729</div>
730<div class="tsd-parameters">
731<h4 class="tsd-parameters-title">Parameters</h4>
732<ul class="tsd-parameter-list">
733<li>
3bd6a82e 734<h5><span class="tsd-kind-parameter">emitter</span>: <span class="tsd-signature-type ">EventEmitter</span></h5></li>
41015374 735<li>
3bd6a82e 736<h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span></h5>
41015374 737<div class="tsd-comment tsd-typography"><p>The name of the event being listened for</p>
15d6dfaf 738</div>
739<div class="tsd-comment tsd-typography"></div></li>
41015374 740<li>
3bd6a82e 741<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type ">StaticEventEmitterOptions</span></h5></li></ul></div>
fab6d3b5 742<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">AsyncIterableIterator</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></h4><p>that iterates <code>eventName</code> events emitted by the <code>emitter</code></p>
15d6dfaf 743
744<div class="tsd-comment tsd-typography">
745<h4>Since</h4><p>v13.6.0, v12.16.0</p>
746</div><aside class="tsd-sources">
912e1dfa 747<p>Inherited from EventEmitter.on</p>
41015374 748<ul>
3c7c9bd1 749<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:250</li></ul></aside></li></ul></section>
3bd6a82e 750<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="once-2" class="tsd-anchor"></a>
15d6dfaf 751<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>once</span><a href="#once-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 752<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 753<li class="tsd-signature tsd-anchor-link" id="once-2.once-3"><span class="tsd-kind-call-signature">once</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span>, <span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">options</span><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">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span><a href="#once-2.once-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
754<li class="tsd-description">
755<div class="tsd-comment tsd-typography"><p>Creates a <code>Promise</code> that is fulfilled when the <code>EventEmitter</code> emits the given
756event or that is rejected if the <code>EventEmitter</code> emits <code>&#39;error&#39;</code> while waiting.
757The <code>Promise</code> will resolve with an array of all the arguments emitted to the
758given event.</p>
759<p>This method is intentionally generic and works with the web platform <a href="https://dom.spec.whatwg.org/#interface-eventtarget">EventTarget</a> interface, which has no special<code>&#39;error&#39;</code> event
760semantics and does not listen to the <code>&#39;error&#39;</code> event.</p>
2c94c3a5 761<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">once</span><span class="hl-0">, </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><span class="hl-5">import</span><span class="hl-0"> </span><span class="hl-3">process</span><span class="hl-0"> </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:process&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ee</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-3">process</span><span class="hl-0">.</span><span class="hl-2">nextTick</span><span class="hl-0">(() </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;myevent&#39;</span><span class="hl-0">, </span><span class="hl-1">42</span><span class="hl-0">);</span><br/><span class="hl-0">});</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> [</span><span class="hl-7">value</span><span class="hl-0">] = </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">, </span><span class="hl-6">&#39;myevent&#39;</span><span class="hl-0">);</span><br/><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-3">value</span><span class="hl-0">);</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">err</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">Error</span><span class="hl-0">(</span><span class="hl-6">&#39;kaboom&#39;</span><span class="hl-0">);</span><br/><span class="hl-3">process</span><span class="hl-0">.</span><span class="hl-2">nextTick</span><span class="hl-0">(() </span><span class="hl-4">=&gt;</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;error&#39;</span><span class="hl-0">, </span><span class="hl-3">err</span><span class="hl-0">);</span><br/><span class="hl-0">});</span><br/><br/><span class="hl-5">try</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">, </span><span class="hl-6">&#39;myevent&#39;</span><span class="hl-0">);</span><br/><span class="hl-0">} </span><span class="hl-5">catch</span><span class="hl-0"> (</span><span class="hl-3">err</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">error</span><span class="hl-0">(</span><span class="hl-6">&#39;error happened&#39;</span><span class="hl-0">, </span><span class="hl-3">err</span><span class="hl-0">);</span><br/><span class="hl-0">}</span>
fab6d3b5 762</code><button>Copy</button></pre>
41015374
JB
763<p>The special handling of the <code>&#39;error&#39;</code> event is only used when <code>events.once()</code>is used to wait for another event. If <code>events.once()</code> is used to wait for the
764&#39;<code>error&#39;</code> event itself, then it is treated as any other kind of event without
765special handling:</p>
2c94c3a5 766<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0">, </span><span class="hl-3">once</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ee</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">, </span><span class="hl-6">&#39;error&#39;</span><span class="hl-0">)</span><br/><span class="hl-0"> .</span><span class="hl-2">then</span><span class="hl-0">(([</span><span class="hl-3">err</span><span class="hl-0">]) </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;ok&#39;</span><span class="hl-0">, </span><span class="hl-3">err</span><span class="hl-0">.</span><span class="hl-3">message</span><span class="hl-0">))</span><br/><span class="hl-0"> .</span><span class="hl-2">catch</span><span class="hl-0">((</span><span class="hl-3">err</span><span class="hl-0">) </span><span class="hl-4">=&gt;</span><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">error</span><span class="hl-0">(</span><span class="hl-6">&#39;error&#39;</span><span class="hl-0">, </span><span class="hl-3">err</span><span class="hl-0">.</span><span class="hl-3">message</span><span class="hl-0">));</span><br/><br/><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;error&#39;</span><span class="hl-0">, </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">Error</span><span class="hl-0">(</span><span class="hl-6">&#39;boom&#39;</span><span class="hl-0">));</span><br/><br/><span class="hl-8">// Prints: ok boom</span>
fab6d3b5 767</code><button>Copy</button></pre>
41015374 768<p>An <code>AbortSignal</code> can be used to cancel waiting for the event:</p>
2c94c3a5 769<pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">EventEmitter</span><span class="hl-0">, </span><span class="hl-3">once</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ee</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">ac</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">AbortController</span><span class="hl-0">();</span><br/><br/><span class="hl-4">async</span><span class="hl-0"> </span><span class="hl-4">function</span><span class="hl-0"> </span><span class="hl-2">foo</span><span class="hl-0">(</span><span class="hl-3">emitter</span><span class="hl-0">, </span><span class="hl-3">event</span><span class="hl-0">, </span><span class="hl-3">signal</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-5">try</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-5">await</span><span class="hl-0"> </span><span class="hl-2">once</span><span class="hl-0">(</span><span class="hl-3">emitter</span><span class="hl-0">, </span><span class="hl-3">event</span><span class="hl-0">, { </span><span class="hl-3">signal</span><span class="hl-0"> });</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">log</span><span class="hl-0">(</span><span class="hl-6">&#39;event emitted!&#39;</span><span class="hl-0">);</span><br/><span class="hl-0"> } </span><span class="hl-5">catch</span><span class="hl-0"> (</span><span class="hl-3">error</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-5">if</span><span class="hl-0"> (</span><span class="hl-3">error</span><span class="hl-0">.</span><span class="hl-3">name</span><span class="hl-0"> === </span><span class="hl-6">&#39;AbortError&#39;</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">error</span><span class="hl-0">(</span><span class="hl-6">&#39;Waiting for the event was canceled!&#39;</span><span class="hl-0">);</span><br/><span class="hl-0"> } </span><span class="hl-5">else</span><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-3">console</span><span class="hl-0">.</span><span class="hl-2">error</span><span class="hl-0">(</span><span class="hl-6">&#39;There was an error&#39;</span><span class="hl-0">, </span><span class="hl-3">error</span><span class="hl-0">.</span><span class="hl-3">message</span><span class="hl-0">);</span><br/><span class="hl-0"> }</span><br/><span class="hl-0"> }</span><br/><span class="hl-0">}</span><br/><br/><span class="hl-2">foo</span><span class="hl-0">(</span><span class="hl-3">ee</span><span class="hl-0">, </span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">, </span><span class="hl-3">ac</span><span class="hl-0">.</span><span class="hl-3">signal</span><span class="hl-0">);</span><br/><span class="hl-3">ac</span><span class="hl-0">.</span><span class="hl-2">abort</span><span class="hl-0">(); </span><span class="hl-8">// Abort waiting for the event</span><br/><span class="hl-3">ee</span><span class="hl-0">.</span><span class="hl-2">emit</span><span class="hl-0">(</span><span class="hl-6">&#39;foo&#39;</span><span class="hl-0">); </span><span class="hl-8">// Prints: Waiting for the event was canceled!</span>
fab6d3b5 770</code><button>Copy</button></pre>
41015374
JB
771</div>
772<div class="tsd-parameters">
773<h4 class="tsd-parameters-title">Parameters</h4>
774<ul class="tsd-parameter-list">
775<li>
3bd6a82e 776<h5><span class="tsd-kind-parameter">emitter</span>: <span class="tsd-signature-type ">_NodeEventTarget</span></h5></li>
41015374 777<li>
3bd6a82e 778<h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></h5></li>
41015374 779<li>
3bd6a82e 780<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type ">StaticEventEmitterOptions</span></h5></li></ul></div>
15d6dfaf 781<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">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></h4>
782<div class="tsd-comment tsd-typography">
783<h4>Since</h4><p>v11.13.0, v10.16.0</p>
784</div><aside class="tsd-sources">
912e1dfa 785<p>Inherited from EventEmitter.once</p>
41015374 786<ul>
3c7c9bd1 787<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:189</li></ul></aside></li>
15d6dfaf 788<li class="tsd-signature tsd-anchor-link" id="once-2.once-4"><span class="tsd-kind-call-signature">once</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">emitter</span>, <span class="tsd-kind-parameter">eventName</span>, <span class="tsd-kind-parameter">options</span><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">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span><a href="#once-2.once-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374
JB
789<li class="tsd-description">
790<div class="tsd-parameters">
791<h4 class="tsd-parameters-title">Parameters</h4>
792<ul class="tsd-parameter-list">
793<li>
3bd6a82e 794<h5><span class="tsd-kind-parameter">emitter</span>: <span class="tsd-signature-type ">_DOMEventTarget</span></h5></li>
41015374 795<li>
3bd6a82e 796<h5><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span></h5></li>
41015374 797<li>
3bd6a82e 798<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type ">StaticEventEmitterOptions</span></h5></li></ul></div>
799<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">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources">
912e1dfa 800<p>Inherited from EventEmitter.once</p>
41015374 801<ul>
3c7c9bd1 802<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:190</li></ul></aside></li></ul></section>
3bd6a82e 803<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="setMaxListeners-2" class="tsd-anchor"></a>
15d6dfaf 804<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagStatic">Static</code> <span>set<wbr/>Max<wbr/>Listeners</span><a href="#setMaxListeners-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
3bd6a82e 805<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
15d6dfaf 806<li class="tsd-signature tsd-anchor-link" id="setMaxListeners-2.setMaxListeners-3"><span class="tsd-kind-call-signature">set<wbr/>Max<wbr/>Listeners</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">n</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">eventTargets</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><a href="#setMaxListeners-2.setMaxListeners-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
41015374 807<li class="tsd-description">
2c94c3a5 808<div class="tsd-comment tsd-typography"><pre><code class="language-js"><span class="hl-5">import</span><span class="hl-0"> { </span><span class="hl-3">setMaxListeners</span><span class="hl-0">, </span><span class="hl-3">EventEmitter</span><span class="hl-0"> } </span><span class="hl-5">from</span><span class="hl-0"> </span><span class="hl-6">&#39;node:events&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">target</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventTarget</span><span class="hl-0">();</span><br/><span class="hl-4">const</span><span class="hl-0"> </span><span class="hl-7">emitter</span><span class="hl-0"> = </span><span class="hl-4">new</span><span class="hl-0"> </span><span class="hl-2">EventEmitter</span><span class="hl-0">();</span><br/><br/><span class="hl-2">setMaxListeners</span><span class="hl-0">(</span><span class="hl-1">5</span><span class="hl-0">, </span><span class="hl-3">target</span><span class="hl-0">, </span><span class="hl-3">emitter</span><span class="hl-0">);</span>
fab6d3b5 809</code><button>Copy</button></pre>
41015374
JB
810</div>
811<div class="tsd-parameters">
812<h4 class="tsd-parameters-title">Parameters</h4>
813<ul class="tsd-parameter-list">
814<li>
3bd6a82e 815<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">n</span>: <span class="tsd-signature-type">number</span></h5>
41015374 816<div class="tsd-comment tsd-typography"><p>A non-negative number. The maximum number of listeners per <code>EventTarget</code> event.</p>
15d6dfaf 817</div>
818<div class="tsd-comment tsd-typography"></div></li>
41015374 819<li>
3bd6a82e 820<h5><code class="tsd-tag ts-flagRest">Rest</code> <span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">eventTargets</span>: <span class="tsd-signature-symbol">(</span><span class="tsd-signature-type ">EventEmitter</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">_DOMEventTarget</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span></h5></li></ul></div>
15d6dfaf 821<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
822<div class="tsd-comment tsd-typography">
823<h4>Since</h4><p>v15.4.0</p>
824</div><aside class="tsd-sources">
912e1dfa 825<p>Inherited from EventEmitter.setMaxListeners</p>
41015374 826<ul>
3c7c9bd1 827<li>Defined in node_modules/.pnpm/@types+node@20.4.6/node_modules/@types/node/events.d.ts:340</li></ul></aside></li></ul></section></section></div>
ec06e4dd 828<div class="col-sidebar">
829<div class="page-menu">
41015374
JB
830<div class="tsd-navigation settings">
831<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
15d6dfaf 832<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)" id="icon-chevronDown"></path></svg>Settings</h3></summary>
41015374
JB
833<div class="tsd-accordion-details">
834<div class="tsd-filter-visibility">
835<h4 class="uppercase">Member Visibility</h4><form>
836<ul id="tsd-filter-options">
837<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
838<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li>
839<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li>
840<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div>
841<div class="tsd-theme-toggle">
3bd6a82e 842<h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
ec06e4dd 843<details open class="tsd-index-accordion tsd-page-navigation"><summary class="tsd-accordion-summary">
15d6dfaf 844<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="#icon-chevronDown"></use></svg>On This Page</h3></summary>
41015374
JB
845<div class="tsd-accordion-details">
846<ul>
15d6dfaf 847<li><a href="#constructor" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-512"></use></svg><span>constructor</span></a></li>
848<li><a href="#captureRejectionSymbol" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>capture<wbr/>Rejection<wbr/>Symbol</span></a></li>
849<li><a href="#captureRejections" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>capture<wbr/>Rejections</span></a></li>
850<li><a href="#defaultMaxListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>default<wbr/>Max<wbr/>Listeners</span></a></li>
851<li><a href="#errorMonitor" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-1024"></use></svg><span>error<wbr/>Monitor</span></a></li>
852<li><a href="#addListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>add<wbr/>Listener</span></a></li>
853<li><a href="#emit" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>emit</span></a></li>
854<li><a href="#eventNames" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>event<wbr/>Names</span></a></li>
855<li><a href="#getMaxListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Max<wbr/>Listeners</span></a></li>
856<li><a href="#listenerCount" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>listener<wbr/>Count</span></a></li>
857<li><a href="#listeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>listeners</span></a></li>
858<li><a href="#off" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>off</span></a></li>
859<li><a href="#on" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>on</span></a></li>
860<li><a href="#once" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>once</span></a></li>
861<li><a href="#prependListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>prepend<wbr/>Listener</span></a></li>
862<li><a href="#prependOnceListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>prepend<wbr/>Once<wbr/>Listener</span></a></li>
863<li><a href="#rawListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>raw<wbr/>Listeners</span></a></li>
864<li><a href="#removeAllListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>remove<wbr/>All<wbr/>Listeners</span></a></li>
865<li><a href="#removeListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>remove<wbr/>Listener</span></a></li>
866<li><a href="#setMaxListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>set<wbr/>Max<wbr/>Listeners</span></a></li>
867<li><a href="#getEventListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Event<wbr/>Listeners</span></a></li>
3c7c9bd1 868<li><a href="#getMaxListeners-2" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Max<wbr/>Listeners</span></a></li>
15d6dfaf 869<li><a href="#listenerCount-2" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>listener<wbr/>Count</span></a></li>
870<li><a href="#on-2" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>on</span></a></li>
871<li><a href="#once-2" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>once</span></a></li>
872<li><a href="#setMaxListeners-2" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>set<wbr/>Max<wbr/>Listeners</span></a></li></ul></div></details></div>
ec06e4dd 873<div class="site-menu">
3c7c9bd1 874<nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.33 16V7.24H10.77L13.446 14.74C13.43 14.54 13.41 14.296 13.386 14.008C13.37 13.712 13.354 13.404 13.338 13.084C13.33 12.756 13.326 12.448 13.326 12.16V7.24H14.37V16H12.93L10.266 8.5C10.282 8.692 10.298 8.936 10.314 9.232C10.33 9.52 10.342 9.828 10.35 10.156C10.366 10.476 10.374 10.784 10.374 11.08V16H9.33Z" fill="var(--color-text)"></path></g></svg><span>poolifier -<wbr/> v2.6.21</span></a>
ec06e4dd 875<ul class="tsd-small-nested-navigation">
15d6dfaf 876<li><a href="AbstractPool.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-128"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.898 16.1201C11.098 16.1201 10.466 15.8961 10.002 15.4481C9.53803 15.0001 9.30603 14.3841 9.30603 13.6001V9.64012C9.30603 8.85612 9.53803 8.24012 10.002 7.79212C10.466 7.34412 11.098 7.12012 11.898 7.12012C12.682 7.12012 13.306 7.34812 13.77 7.80412C14.234 8.25212 14.466 8.86412 14.466 9.64012H13.386C13.386 9.14412 13.254 8.76412 12.99 8.50012C12.734 8.22812 12.37 8.09212 11.898 8.09212C11.426 8.09212 11.054 8.22412 10.782 8.48812C10.518 8.75212 10.386 9.13212 10.386 9.62812V13.6001C10.386 14.0961 10.518 14.4801 10.782 14.7521C11.054 15.0161 11.426 15.1481 11.898 15.1481C12.37 15.1481 12.734 15.0161 12.99 14.7521C13.254 14.4801 13.386 14.0961 13.386 13.6001H14.466C14.466 14.3761 14.234 14.9921 13.77 15.4481C13.306 15.8961 12.682 16.1201 11.898 16.1201Z" fill="var(--color-text)"></path></g></svg><span>Abstract<wbr/>Pool</span></a></li>
877<li><a href="AbstractWorker.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Abstract<wbr/>Worker</span></a></li>
878<li><a href="CircularArray.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Circular<wbr/>Array</span></a></li>
879<li><a href="ClusterWorker.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Cluster<wbr/>Worker</span></a></li>
880<li><a href="DynamicClusterPool.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Dynamic<wbr/>Cluster<wbr/>Pool</span></a></li>
881<li><a href="DynamicThreadPool.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Dynamic<wbr/>Thread<wbr/>Pool</span></a></li>
882<li><a href="FixedClusterPool.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Fixed<wbr/>Cluster<wbr/>Pool</span></a></li>
883<li><a href="FixedThreadPool.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Fixed<wbr/>Thread<wbr/>Pool</span></a></li>
884<li><a href="PoolEmitter.html" class="current"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Pool<wbr/>Emitter</span></a></li>
885<li><a href="Queue.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Queue</span></a></li>
886<li><a href="ThreadWorker.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Thread<wbr/>Worker</span></a></li>
887<li><a href="WorkerChoiceStrategyContext.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-128"></use></svg><span>Worker<wbr/>Choice<wbr/>Strategy<wbr/>Context</span></a></li>
888<li><a href="../interfaces/ClusterPoolOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-256"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)"></path></g></svg><span>Cluster<wbr/>Pool<wbr/>Options</span></a></li>
f05afd16 889<li><a href="../interfaces/EventLoopUtilizationMeasurementStatistics.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Event<wbr/>Loop<wbr/>Utilization<wbr/>Measurement<wbr/>Statistics</span></a></li>
15d6dfaf 890<li><a href="../interfaces/IPool.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>IPool</span></a></li>
891<li><a href="../interfaces/IWorker.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>IWorker</span></a></li>
892<li><a href="../interfaces/IWorkerChoiceStrategy.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>IWorker<wbr/>Choice<wbr/>Strategy</span></a></li>
a6b5c73c 893<li><a href="../interfaces/IWorkerNode.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>IWorker<wbr/>Node</span></a></li>
f05afd16 894<li><a href="../interfaces/MeasurementOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Measurement<wbr/>Options</span></a></li>
895<li><a href="../interfaces/MeasurementStatistics.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Measurement<wbr/>Statistics</span></a></li>
896<li><a href="../interfaces/MeasurementStatisticsRequirements.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Measurement<wbr/>Statistics<wbr/>Requirements</span></a></li>
15d6dfaf 897<li><a href="../interfaces/MessageValue.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Message<wbr/>Value</span></a></li>
898<li><a href="../interfaces/PoolInfo.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Pool<wbr/>Info</span></a></li>
899<li><a href="../interfaces/PoolOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Pool<wbr/>Options</span></a></li>
900<li><a href="../interfaces/PromiseResponseWrapper.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Promise<wbr/>Response<wbr/>Wrapper</span></a></li>
aba8d9bd 901<li><a href="../interfaces/StrategyPolicy.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Strategy<wbr/>Policy</span></a></li>
15d6dfaf 902<li><a href="../interfaces/Task.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Task</span></a></li>
f05afd16 903<li><a href="../interfaces/TaskError.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Task<wbr/>Error</span></a></li>
71056a0a 904<li><a href="../interfaces/TaskPerformance.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Task<wbr/>Performance</span></a></li>
afa30fd0 905<li><a href="../interfaces/TaskStatistics.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Task<wbr/>Statistics</span></a></li>
f05afd16 906<li><a href="../interfaces/TaskStatisticsRequirements.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Task<wbr/>Statistics<wbr/>Requirements</span></a></li>
15d6dfaf 907<li><a href="../interfaces/TasksQueueOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Tasks<wbr/>Queue<wbr/>Options</span></a></li>
f45a3823 908<li><a href="../interfaces/ThreadPoolOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Thread<wbr/>Pool<wbr/>Options</span></a></li>
15d6dfaf 909<li><a href="../interfaces/WorkerChoiceStrategyOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Worker<wbr/>Choice<wbr/>Strategy<wbr/>Options</span></a></li>
ac2cb9e2 910<li><a href="../interfaces/WorkerInfo.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Worker<wbr/>Info</span></a></li>
15d6dfaf 911<li><a href="../interfaces/WorkerOptions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Worker<wbr/>Options</span></a></li>
71056a0a 912<li><a href="../interfaces/WorkerStatistics.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Worker<wbr/>Statistics</span></a></li>
f05afd16 913<li><a href="../interfaces/WorkerUsage.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-256"></use></svg><span>Worker<wbr/>Usage</span></a></li>
030eb5a3 914<li><a href="../types/ErrorHandler.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-4194304"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)"></path></g></svg><span>Error<wbr/>Handler</span></a></li>
15d6dfaf 915<li><a href="../types/ExitHandler.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Exit<wbr/>Handler</span></a></li>
916<li><a href="../types/KillBehavior.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Kill<wbr/>Behavior</span></a></li>
f05afd16 917<li><a href="../types/Measurement.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Measurement</span></a></li>
15d6dfaf 918<li><a href="../types/MessageHandler.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Message<wbr/>Handler</span></a></li>
919<li><a href="../types/OnlineHandler.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Online<wbr/>Handler</span></a></li>
920<li><a href="../types/PoolEvent.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Pool<wbr/>Event</span></a></li>
921<li><a href="../types/PoolType.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Pool<wbr/>Type</span></a></li>
3c7c9bd1 922<li><a href="../types/TaskAsyncFunction.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Task<wbr/>Async<wbr/>Function</span></a></li>
923<li><a href="../types/TaskFunction.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Task<wbr/>Function</span></a></li>
15d6dfaf 924<li><a href="../types/TaskFunctions.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Task<wbr/>Functions</span></a></li>
3c7c9bd1 925<li><a href="../types/TaskSyncFunction.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Task<wbr/>Sync<wbr/>Function</span></a></li>
15d6dfaf 926<li><a href="../types/WorkerChoiceStrategy.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Worker<wbr/>Choice<wbr/>Strategy</span></a></li>
15d6dfaf 927<li><a href="../types/WorkerType.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-4194304"></use></svg><span>Worker<wbr/>Type</span></a></li>
928<li><a href="../variables/KillBehaviors.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-32"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-variable)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M11.106 16L8.85 7.24H9.966L11.454 13.192C11.558 13.608 11.646 13.996 11.718 14.356C11.79 14.708 11.842 14.976 11.874 15.16C11.906 14.976 11.954 14.708 12.018 14.356C12.09 13.996 12.178 13.608 12.282 13.192L13.758 7.24H14.85L12.582 16H11.106Z" fill="var(--color-text)"></path></g></svg><span>Kill<wbr/>Behaviors</span></a></li>
f05afd16 929<li><a href="../variables/Measurements.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-32"></use></svg><span>Measurements</span></a></li>
15d6dfaf 930<li><a href="../variables/PoolEvents.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-32"></use></svg><span>Pool<wbr/>Events</span></a></li>
931<li><a href="../variables/PoolTypes.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-32"></use></svg><span>Pool<wbr/>Types</span></a></li>
932<li><a href="../variables/WorkerChoiceStrategies.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-32"></use></svg><span>Worker<wbr/>Choice<wbr/>Strategies</span></a></li>
a97f9c80 933<li><a href="../variables/WorkerTypes.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-32"></use></svg><span>Worker<wbr/>Types</span></a></li>
934<li><a href="../functions/availableParallelism.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><g id="icon-64"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)"></path></g></svg><span>available<wbr/>Parallelism</span></a></li></ul></nav></div></div></div>
ec06e4dd 935<div class="tsd-generator">
41015374 936<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
ec06e4dd 937<div class="overlay"></div></body></html>