Commit | Line | Data |
---|---|---|
224d0081 DB |
1 | <!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>IWorkerNode | poolifier - v4.0.15</title><meta name="description" content="Documentation for poolifier"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">poolifier - v4.0.15</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../index.html">poolifier</a></li><li><a href="IWorkerNode.html">IWorkerNode</a></li></ul><h1>Interface IWorkerNode<Worker, Data><code class="tsd-tag">Internal</code></h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Worker node interface.</p> |
2 | </div><div class="tsd-comment tsd-typography"></div></section><div class="tsd-signature"><span class="tsd-signature-keyword">interface </span><span class="tsd-kind-interface">IWorkerNode</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Worker">Worker</a><span class="tsd-signature-symbol">, </span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Data">Data</a><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#clearTasksQueue">clearTasksQueue</a><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-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#deleteTaskFunctionWorkerUsage">deleteTaskFunctionWorkerUsage</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#dequeueLastPrioritizedTask">dequeueLastPrioritizedTask</a><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-symbol"> => </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="Task.html" class="tsd-signature-type tsd-kind-interface">Task</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Data">Data</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#dequeueTask">dequeueTask</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">bucket</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="Task.html" class="tsd-signature-type tsd-kind-interface">Task</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Data">Data</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#enqueueTask">enqueueTask</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">task</span><span class="tsd-signature-symbol">: </span><a href="Task.html" class="tsd-signature-type tsd-kind-interface">Task</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Data">Data</a><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><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#getTaskFunctionWorkerUsage">getTaskFunctionWorkerUsage</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="WorkerUsage.html" class="tsd-signature-type tsd-kind-interface">WorkerUsage</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#hasBackPressure">hasBackPressure</a><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-symbol"> => </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#info">info</a><span class="tsd-signature-symbol">: </span><a href="WorkerInfo.html" class="tsd-signature-type tsd-kind-interface">WorkerInfo</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#messageChannel">messageChannel</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">MessageChannel</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#registerOnceWorkerEventHandler">registerOnceWorkerEventHandler</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, <span class="tsd-kind-parameter">handler</span><span class="tsd-signature-symbol">: </span><a href="../types/EventHandler.html" class="tsd-signature-type tsd-kind-type-alias">EventHandler</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Worker">Worker</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#registerWorkerEventHandler">registerWorkerEventHandler</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, <span class="tsd-kind-parameter">handler</span><span class="tsd-signature-symbol">: </span><a href="../types/EventHandler.html" class="tsd-signature-type tsd-kind-type-alias">EventHandler</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Worker">Worker</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#setTasksQueuePriority">setTasksQueuePriority</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">enablePriority</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#strategyData">strategyData</a><span class="tsd-signature-symbol">?: </span><a href="StrategyData.html" class="tsd-signature-type tsd-kind-interface">StrategyData</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#tasksQueueBackPressureSize">tasksQueueBackPressureSize</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#tasksQueueSize">tasksQueueSize</a><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-symbol"> => </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#terminate">terminate</a><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-symbol"> => </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#usage">usage</a><span class="tsd-signature-symbol">: </span><a href="WorkerUsage.html" class="tsd-signature-type tsd-kind-interface">WorkerUsage</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="IWorkerNode.html#worker-1">worker</a><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Worker">Worker</a><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="IWorkerNode.html#_captureRejectionSymbol_._captureRejectionSymbol_-1">[captureRejectionSymbol]</a><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#_captureRejectionSymbol_._captureRejectionSymbol_-1.K">K</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Error</span>, <span class="tsd-kind-parameter">event</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-kind-parameter">args</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">AnyRest</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="IWorkerNode.html#addListener.addListener-1">addListener</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#addListener.addListener-1.K-1">K</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</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-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-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="IWorkerNode.html#emit.emit-1">emit</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#emit.emit-1.K-2">K</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</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-kind-parameter">args</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">AnyRest</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="IWorkerNode.html#eventNames.eventNames-1">eventNames</a><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><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="IWorkerNode.html#getMaxListeners.getMaxListeners-1">getMaxListeners</a><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><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="IWorkerNode.html#listenerCount.listenerCount-1">listenerCount</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#listenerCount.listenerCount-1.K-3">K</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</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-kind-parameter">listener</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="IWorkerNode.html#listeners.listeners-1">listeners</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#listeners.listeners-1.K-4">K</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</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><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="IWorkerNode.html#off.off-1">off</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#off.off-1.K-5">K</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</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-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-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="IWorkerNode.html#on.on-1">on</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#on.on-1.K-6">K</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</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-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-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="IWorkerNode.html#once.once-1">once</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#once.once-1.K-7">K</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</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-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-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="IWorkerNode.html#prependListener.prependListener-1">prependListener</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#prependListener.prependListener-1.K-8">K</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</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-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-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="IWorkerNode.html#prependOnceListener.prependOnceListener-1">prependOnceListener</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#prependOnceListener.prependOnceListener-1.K-9">K</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</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-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-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="IWorkerNode.html#rawListeners.rawListeners-1">rawListeners</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#rawListeners.rawListeners-1.K-10">K</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</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><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="IWorkerNode.html#removeAllListeners.removeAllListeners-1">removeAllListeners</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</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><span class="tsd-signature-type">this</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="IWorkerNode.html#removeListener.removeListener-1">removeListener</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#removeListener.removeListener-1.K-11">K</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">eventName</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-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-symbol">...</span><span class="tsd-kind-parameter">args</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-call-signature" href="IWorkerNode.html#setMaxListeners.setMaxListeners-1">setMaxListeners</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">n</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">this</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div> <section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="Worker" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Worker</span><span class="tsd-signature-keyword"> extends </span><a href="IWorker.html" class="tsd-signature-type tsd-kind-interface">IWorker</a></span><div class="tsd-comment tsd-typography"><p>Type of worker.</p> | |
86de0a2d | 3 | </div><div class="tsd-comment tsd-typography"></div></li><li><span><a id="Data" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">Data</span> = <span class="tsd-signature-type">unknown</span></span><div class="tsd-comment tsd-typography"><p>Type of data sent to the worker. This can only be structured-cloneable data.</p> |
224d0081 | 4 | </div><div class="tsd-comment tsd-typography"></div></li></ul></section> <section class="tsd-panel tsd-hierarchy"><h4>Hierarchy</h4><ul class="tsd-hierarchy"><li><span class="tsd-signature-type">EventEmitter</span><ul class="tsd-hierarchy"><li><span class="target">IWorkerNode</span></li></ul></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L276">src/pools/worker.ts:276</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="IWorkerNode.html#clearTasksQueue" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>clear<wbr/>Tasks<wbr/>Queue</span></a> |
86de0a2d | 5 | <a href="IWorkerNode.html#deleteTaskFunctionWorkerUsage" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>delete<wbr/>Task<wbr/>Function<wbr/>Worker<wbr/>Usage</span></a> |
f682cfbe | 6 | <a href="IWorkerNode.html#dequeueLastPrioritizedTask" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dequeue<wbr/>Last<wbr/>Prioritized<wbr/>Task</span></a> |
86de0a2d DB |
7 | <a href="IWorkerNode.html#dequeueTask" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dequeue<wbr/>Task</span></a> |
8 | <a href="IWorkerNode.html#enqueueTask" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>enqueue<wbr/>Task</span></a> | |
9 | <a href="IWorkerNode.html#getTaskFunctionWorkerUsage" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>get<wbr/>Task<wbr/>Function<wbr/>Worker<wbr/>Usage</span></a> | |
10 | <a href="IWorkerNode.html#hasBackPressure" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>has<wbr/>Back<wbr/>Pressure</span></a> | |
11 | <a href="IWorkerNode.html#info" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>info</span></a> | |
12 | <a href="IWorkerNode.html#messageChannel" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>message<wbr/>Channel?</span></a> | |
86de0a2d DB |
13 | <a href="IWorkerNode.html#registerOnceWorkerEventHandler" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>register<wbr/>Once<wbr/>Worker<wbr/>Event<wbr/>Handler</span></a> |
14 | <a href="IWorkerNode.html#registerWorkerEventHandler" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>register<wbr/>Worker<wbr/>Event<wbr/>Handler</span></a> | |
fcb83cac | 15 | <a href="IWorkerNode.html#setTasksQueuePriority" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>set<wbr/>Tasks<wbr/>Queue<wbr/>Priority</span></a> |
86de0a2d DB |
16 | <a href="IWorkerNode.html#strategyData" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Data?</span></a> |
17 | <a href="IWorkerNode.html#tasksQueueBackPressureSize" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>tasks<wbr/>Queue<wbr/>Back<wbr/>Pressure<wbr/>Size</span></a> | |
18 | <a href="IWorkerNode.html#tasksQueueSize" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>tasks<wbr/>Queue<wbr/>Size</span></a> | |
19 | <a href="IWorkerNode.html#terminate" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>terminate</span></a> | |
86de0a2d DB |
20 | <a href="IWorkerNode.html#usage" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>usage</span></a> |
21 | <a href="IWorkerNode.html#worker-1" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>worker</span></a> | |
22 | </div></section><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="IWorkerNode.html#_captureRejectionSymbol_" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>[capture<wbr/>Rejection<wbr/>Symbol]?</span></a> | |
23 | <a href="IWorkerNode.html#addListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Listener</span></a> | |
24 | <a href="IWorkerNode.html#emit" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>emit</span></a> | |
25 | <a href="IWorkerNode.html#eventNames" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>event<wbr/>Names</span></a> | |
26 | <a href="IWorkerNode.html#getMaxListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Max<wbr/>Listeners</span></a> | |
27 | <a href="IWorkerNode.html#listenerCount" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>listener<wbr/>Count</span></a> | |
28 | <a href="IWorkerNode.html#listeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>listeners</span></a> | |
29 | <a href="IWorkerNode.html#off" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>off</span></a> | |
30 | <a href="IWorkerNode.html#on" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on</span></a> | |
31 | <a href="IWorkerNode.html#once" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>once</span></a> | |
32 | <a href="IWorkerNode.html#prependListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>prepend<wbr/>Listener</span></a> | |
33 | <a href="IWorkerNode.html#prependOnceListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>prepend<wbr/>Once<wbr/>Listener</span></a> | |
34 | <a href="IWorkerNode.html#rawListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>raw<wbr/>Listeners</span></a> | |
35 | <a href="IWorkerNode.html#removeAllListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>All<wbr/>Listeners</span></a> | |
36 | <a href="IWorkerNode.html#removeListener" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Listener</span></a> | |
37 | <a href="IWorkerNode.html#setMaxListeners" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Max<wbr/>Listeners</span></a> | |
224d0081 DB |
38 | </div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="clearTasksQueue" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>clear<wbr/>Tasks<wbr/>Queue</span><a href="#clearTasksQueue" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">clear<wbr/>Tasks<wbr/>Queue</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-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></div><div class="tsd-comment tsd-typography"><p>Clears tasks queue.</p> |
39 | </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L334">src/pools/worker.ts:334</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="deleteTaskFunctionWorkerUsage" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>delete<wbr/>Task<wbr/>Function<wbr/>Worker<wbr/>Usage</span><a href="#deleteTaskFunctionWorkerUsage" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">delete<wbr/>Task<wbr/>Function<wbr/>Worker<wbr/>Usage</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span></div><div class="tsd-comment tsd-typography"><p>Deletes task function worker usage statistics.</p> | |
86de0a2d | 40 | </div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature" id="deleteTaskFunctionWorkerUsage.__type-2.__type-3"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">name</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The task function name.</p> |
224d0081 DB |
41 | </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p><code>true</code> if the task function worker usage statistics were deleted, <code>false</code> otherwise.</p> |
42 | <div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L373">src/pools/worker.ts:373</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="dequeueLastPrioritizedTask" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>dequeue<wbr/>Last<wbr/>Prioritized<wbr/>Task</span><a href="#dequeueLastPrioritizedTask" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">dequeue<wbr/>Last<wbr/>Prioritized<wbr/>Task</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-symbol"> => </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="Task.html" class="tsd-signature-type tsd-kind-interface">Task</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Data">Data</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span></div><div class="tsd-comment tsd-typography"><p>Dequeue last prioritized task.</p> | |
43 | </div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature" id="dequeueLastPrioritizedTask.__type-4.__type-5"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="Task.html" class="tsd-signature-type tsd-kind-interface">Task</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Data">Data</a><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="Task.html" class="tsd-signature-type tsd-kind-interface">Task</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Data">Data</a><span class="tsd-signature-symbol">></span></h4><p>The dequeued task.</p> | |
44 | <div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L330">src/pools/worker.ts:330</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="dequeueTask" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>dequeue<wbr/>Task</span><a href="#dequeueTask" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">dequeue<wbr/>Task</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">bucket</span><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="Task.html" class="tsd-signature-type tsd-kind-interface">Task</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Data">Data</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span></div><div class="tsd-comment tsd-typography"><p>Dequeue task.</p> | |
45 | </div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature" id="dequeueTask.__type-6.__type-7"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">bucket</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="Task.html" class="tsd-signature-type tsd-kind-interface">Task</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Data">Data</a><span class="tsd-signature-symbol">></span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">bucket</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>The prioritized bucket to dequeue from.</p> | |
46 | </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="Task.html" class="tsd-signature-type tsd-kind-interface">Task</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Data">Data</a><span class="tsd-signature-symbol">></span></h4><p>The dequeued task.</p> | |
47 | <div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Default Value" class="tsd-anchor"></a>Default Value<a href="#Default Value" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><pre><code class="ts"><span class="hl-8">0</span> | |
48 | </code><button type="button">Copy</button></pre> | |
49 | ||
50 | </div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L325">src/pools/worker.ts:325</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="enqueueTask" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>enqueue<wbr/>Task</span><a href="#enqueueTask" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">enqueue<wbr/>Task</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">task</span><span class="tsd-signature-symbol">: </span><a href="Task.html" class="tsd-signature-type tsd-kind-interface">Task</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Data">Data</a><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><span class="tsd-signature-symbol">)</span></div><div class="tsd-comment tsd-typography"><p>Enqueue task.</p> | |
f30cddb8 | 51 | </div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature" id="enqueueTask.__type-8.__type-9"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">task</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">task</span>: <a href="Task.html" class="tsd-signature-type tsd-kind-interface">Task</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Data">Data</a><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>The task to queue.</p> |
224d0081 DB |
52 | </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><p>The tasks queue size.</p> |
53 | <div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L319">src/pools/worker.ts:319</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="getTaskFunctionWorkerUsage" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>get<wbr/>Task<wbr/>Function<wbr/>Worker<wbr/>Usage</span><a href="#getTaskFunctionWorkerUsage" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">get<wbr/>Task<wbr/>Function<wbr/>Worker<wbr/>Usage</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="WorkerUsage.html" class="tsd-signature-type tsd-kind-interface">WorkerUsage</a><span class="tsd-signature-symbol">)</span></div><div class="tsd-comment tsd-typography"><p>Gets task function worker usage statistics.</p> | |
f30cddb8 | 54 | </div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature" id="getTaskFunctionWorkerUsage.__type-10.__type-11"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">name</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="WorkerUsage.html" class="tsd-signature-type tsd-kind-interface">WorkerUsage</a></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">name</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The task function name.</p> |
224d0081 DB |
55 | </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><a href="WorkerUsage.html" class="tsd-signature-type tsd-kind-interface">WorkerUsage</a></h4><p>The task function worker usage statistics if the task function worker usage statistics are initialized, <code>undefined</code> otherwise.</p> |
56 | <div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L367">src/pools/worker.ts:367</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="hasBackPressure" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>has<wbr/>Back<wbr/>Pressure</span><a href="#hasBackPressure" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">has<wbr/>Back<wbr/>Pressure</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-symbol"> => </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span></div><div class="tsd-comment tsd-typography"><p>Whether the worker node has back pressure (i.e. its tasks queue is full).</p> | |
57 | </div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature" id="hasBackPressure.__type-12.__type-13"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><p><code>true</code> if the worker node has back pressure, <code>false</code> otherwise.</p> | |
58 | <div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L339">src/pools/worker.ts:339</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="info" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>info</span><a href="#info" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">info</span><span class="tsd-signature-symbol">:</span> <a href="WorkerInfo.html" class="tsd-signature-type tsd-kind-interface">WorkerInfo</a></div><div class="tsd-comment tsd-typography"><p>Worker info.</p> | |
59 | </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L285">src/pools/worker.ts:285</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="messageChannel" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Optional</code> <code class="tsd-tag">Readonly</code><span>message<wbr/>Channel</span><a href="#messageChannel" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">message<wbr/>Channel</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">MessageChannel</span></div><div class="tsd-comment tsd-typography"><p>Message channel (worker thread only).</p> | |
60 | </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L298">src/pools/worker.ts:298</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="registerOnceWorkerEventHandler" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>register<wbr/>Once<wbr/>Worker<wbr/>Event<wbr/>Handler</span><a href="#registerOnceWorkerEventHandler" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">register<wbr/>Once<wbr/>Worker<wbr/>Event<wbr/>Handler</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, <span class="tsd-kind-parameter">handler</span><span class="tsd-signature-symbol">: </span><a href="../types/EventHandler.html" class="tsd-signature-type tsd-kind-type-alias">EventHandler</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Worker">Worker</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></div><div class="tsd-comment tsd-typography"><p>Registers once a worker event handler.</p> | |
f30cddb8 | 61 | </div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature" id="registerOnceWorkerEventHandler.__type-14.__type-15"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">handler</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The event.</p> |
86de0a2d | 62 | </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">handler</span>: <a href="../types/EventHandler.html" class="tsd-signature-type tsd-kind-type-alias">EventHandler</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Worker">Worker</a><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>The event handler.</p> |
224d0081 | 63 | </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L358">src/pools/worker.ts:358</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="registerWorkerEventHandler" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>register<wbr/>Worker<wbr/>Event<wbr/>Handler</span><a href="#registerWorkerEventHandler" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">register<wbr/>Worker<wbr/>Event<wbr/>Handler</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, <span class="tsd-kind-parameter">handler</span><span class="tsd-signature-symbol">: </span><a href="../types/EventHandler.html" class="tsd-signature-type tsd-kind-type-alias">EventHandler</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Worker">Worker</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></div><div class="tsd-comment tsd-typography"><p>Registers a worker event handler.</p> |
f30cddb8 | 64 | </div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature" id="registerWorkerEventHandler.__type-16.__type-17"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">event</span>, <span class="tsd-kind-parameter">handler</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">event</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>The event.</p> |
86de0a2d | 65 | </div><div class="tsd-comment tsd-typography"></div></li><li><span><span class="tsd-kind-parameter">handler</span>: <a href="../types/EventHandler.html" class="tsd-signature-type tsd-kind-type-alias">EventHandler</a><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Worker">Worker</a><span class="tsd-signature-symbol">></span></span><div class="tsd-comment tsd-typography"><p>The event handler.</p> |
224d0081 | 66 | </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L349">src/pools/worker.ts:349</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="setTasksQueuePriority" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>set<wbr/>Tasks<wbr/>Queue<wbr/>Priority</span><a href="#setTasksQueuePriority" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">set<wbr/>Tasks<wbr/>Queue<wbr/>Priority</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">enablePriority</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></div><div class="tsd-comment tsd-typography"><p>Sets tasks queue priority.</p> |
fcb83cac | 67 | </div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature" id="setTasksQueuePriority.__type-18.__type-19"><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">enablePriority</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">enablePriority</span>: <span class="tsd-signature-type">boolean</span></span><div class="tsd-comment tsd-typography"><p>Whether to enable tasks queue priority.</p> |
224d0081 | 68 | </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L308">src/pools/worker.ts:308</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="strategyData" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Optional</code><span>strategy<wbr/>Data</span><a href="#strategyData" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">strategy<wbr/>Data</span><span class="tsd-signature-symbol">?:</span> <a href="StrategyData.html" class="tsd-signature-type tsd-kind-interface">StrategyData</a></div><div class="tsd-comment tsd-typography"><p>Worker choice strategy data. |
fc09c6dc | 69 | This is used to store data that are specific to the worker choice strategy.</p> |
224d0081 | 70 | </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L294">src/pools/worker.ts:294</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="tasksQueueBackPressureSize" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>tasks<wbr/>Queue<wbr/>Back<wbr/>Pressure<wbr/>Size</span><a href="#tasksQueueBackPressureSize" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">tasks<wbr/>Queue<wbr/>Back<wbr/>Pressure<wbr/>Size</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>Tasks queue back pressure size. |
31542ddf | 71 | This is the number of tasks that can be enqueued before the worker node has back pressure.</p> |
224d0081 DB |
72 | </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L303">src/pools/worker.ts:303</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="tasksQueueSize" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>tasks<wbr/>Queue<wbr/>Size</span><a href="#tasksQueueSize" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">tasks<wbr/>Queue<wbr/>Size</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-symbol"> => </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span></div><div class="tsd-comment tsd-typography"><p>Tasks queue size.</p> |
73 | </div><div class="tsd-type-declaration"><h4>Type declaration</h4><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures"><li class="tsd-signature" id="tasksQueueSize.__type-20.__type-21"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><p>The tasks queue size.</p> | |
74 | <div class="tsd-comment tsd-typography"></div></li></ul></li></ul></div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L313">src/pools/worker.ts:313</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="terminate" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>terminate</span><a href="#terminate" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">terminate</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-symbol"> => </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span></div><div class="tsd-comment tsd-typography"><p>Terminates the worker node.</p> | |
75 | </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L343">src/pools/worker.ts:343</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="usage" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>usage</span><a href="#usage" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">usage</span><span class="tsd-signature-symbol">:</span> <a href="WorkerUsage.html" class="tsd-signature-type tsd-kind-interface">WorkerUsage</a></div><div class="tsd-comment tsd-typography"><p>Worker usage statistics.</p> | |
76 | </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L289">src/pools/worker.ts:289</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="worker-1" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Readonly</code><span>worker</span><a href="#worker-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">worker</span><span class="tsd-signature-symbol">:</span> <a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#Worker">Worker</a></div><div class="tsd-comment tsd-typography"><p>Worker.</p> | |
77 | </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/poolifier/poolifier/blob/dea42379cfdbcf1c1c9800df7c097eab484ebc07/src/pools/worker.ts#L281">src/pools/worker.ts:281</a></li></ul></aside></section></section></details><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="_captureRejectionSymbol_" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Optional</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="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="_captureRejectionSymbol_._captureRejectionSymbol_-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">[capture<wbr/>Rejection<wbr/>Symbol]</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#_captureRejectionSymbol_._captureRejectionSymbol_-1.K">K</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">error</span>, <span class="tsd-kind-parameter">event</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><a href="#_captureRejectionSymbol_._captureRejectionSymbol_-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="_captureRejectionSymbol_._captureRejectionSymbol_-1.K" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">error</span>: <span class="tsd-signature-type">Error</span></span></li><li><span><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></span></li><li><span><code class="tsd-tag">Rest</code><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">AnyRest</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4><aside class="tsd-sources"><p>Inherited from EventEmitter.[captureRejectionSymbol]</p><ul><li>Defined in node_modules/.pnpm/@types+node@20.14.9/node_modules/@types/node/events.d.ts:136</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="addListener" class="tsd-anchor"></a><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="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="addListener.addListener-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">add<wbr/>Listener</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#addListener.addListener-1.K-1">K</a><span class="tsd-signature-symbol">></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-type">this</span><a href="#addListener.addListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Alias for <code>emitter.on(eventName, listener)</code>.</p> | |
78 | </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="addListener.addListener-1.K-1" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li><li><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-kind-parameter">args</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><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><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">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></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Since" class="tsd-anchor"></a>Since<a href="#Since" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>v0.1.26</p> | |
79 | </div><aside class="tsd-sources"><p>Inherited from EventEmitter.addListener</p><ul><li>Defined in node_modules/.pnpm/@types+node@20.14.9/node_modules/@types/node/events.d.ts:597</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="emit" class="tsd-anchor"></a><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="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="emit.emit-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">emit</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#emit.emit-1.K-2">K</a><span class="tsd-signature-symbol">></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="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><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 | |
71218fcd DB |
80 | to each.</p> |
81 | <p>Returns <code>true</code> if the event had listeners, <code>false</code> otherwise.</p> | |
224d0081 DB |
82 | <pre><code class="js"><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-0">EventEmitter</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-5">'node:events'</span><span class="hl-2">;</span><br/><span class="hl-1">const</span><span class="hl-2"> </span><span class="hl-3">myEmitter</span><span class="hl-2"> = </span><span class="hl-1">new</span><span class="hl-2"> </span><span class="hl-6">EventEmitter</span><span class="hl-2">();</span><br/><br/><span class="hl-7">// First listener</span><br/><span class="hl-0">myEmitter</span><span class="hl-2">.</span><span class="hl-6">on</span><span class="hl-2">(</span><span class="hl-5">'event'</span><span class="hl-2">, </span><span class="hl-1">function</span><span class="hl-2"> </span><span class="hl-6">firstListener</span><span class="hl-2">() {</span><br/><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">'Helloooo! first listener'</span><span class="hl-2">);</span><br/><span class="hl-2">});</span><br/><span class="hl-7">// Second listener</span><br/><span class="hl-0">myEmitter</span><span class="hl-2">.</span><span class="hl-6">on</span><span class="hl-2">(</span><span class="hl-5">'event'</span><span class="hl-2">, </span><span class="hl-1">function</span><span class="hl-2"> </span><span class="hl-6">secondListener</span><span class="hl-2">(</span><span class="hl-0">arg1</span><span class="hl-2">, </span><span class="hl-0">arg2</span><span class="hl-2">) {</span><br/><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">`event with parameters </span><span class="hl-1">${</span><span class="hl-0">arg1</span><span class="hl-1">}</span><span class="hl-5">, </span><span class="hl-1">${</span><span class="hl-0">arg2</span><span class="hl-1">}</span><span class="hl-5"> in second listener`</span><span class="hl-2">);</span><br/><span class="hl-2">});</span><br/><span class="hl-7">// Third listener</span><br/><span class="hl-0">myEmitter</span><span class="hl-2">.</span><span class="hl-6">on</span><span class="hl-2">(</span><span class="hl-5">'event'</span><span class="hl-2">, </span><span class="hl-1">function</span><span class="hl-2"> </span><span class="hl-6">thirdListener</span><span class="hl-2">(...</span><span class="hl-0">args</span><span class="hl-2">) {</span><br/><span class="hl-2"> </span><span class="hl-1">const</span><span class="hl-2"> </span><span class="hl-3">parameters</span><span class="hl-2"> = </span><span class="hl-0">args</span><span class="hl-2">.</span><span class="hl-6">join</span><span class="hl-2">(</span><span class="hl-5">', '</span><span class="hl-2">);</span><br/><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">`event with parameters </span><span class="hl-1">${</span><span class="hl-0">parameters</span><span class="hl-1">}</span><span class="hl-5"> in third listener`</span><span class="hl-2">);</span><br/><span class="hl-2">});</span><br/><br/><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-0">myEmitter</span><span class="hl-2">.</span><span class="hl-6">listeners</span><span class="hl-2">(</span><span class="hl-5">'event'</span><span class="hl-2">));</span><br/><br/><span class="hl-0">myEmitter</span><span class="hl-2">.</span><span class="hl-6">emit</span><span class="hl-2">(</span><span class="hl-5">'event'</span><span class="hl-2">, </span><span class="hl-8">1</span><span class="hl-2">, </span><span class="hl-8">2</span><span class="hl-2">, </span><span class="hl-8">3</span><span class="hl-2">, </span><span class="hl-8">4</span><span class="hl-2">, </span><span class="hl-8">5</span><span class="hl-2">);</span><br/><br/><span class="hl-7">// Prints:</span><br/><span class="hl-7">// [</span><br/><span class="hl-7">// [Function: firstListener],</span><br/><span class="hl-7">// [Function: secondListener],</span><br/><span class="hl-7">// [Function: thirdListener]</span><br/><span class="hl-7">// ]</span><br/><span class="hl-7">// Helloooo! first listener</span><br/><span class="hl-7">// event with parameters 1, 2 in second listener</span><br/><span class="hl-7">// event with parameters 1, 2, 3, 4, 5 in third listener</span> |
83 | </code><button type="button">Copy</button></pre> | |
84 | ||
85 | </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="emit.emit-1.K-2" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li><li><span><code class="tsd-tag">Rest</code><span class="tsd-signature-symbol">...</span><span class="tsd-kind-parameter">args</span>: <span class="tsd-signature-type">AnyRest</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Since-1" class="tsd-anchor"></a>Since<a href="#Since-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>v0.1.26</p> | |
86 | </div><aside class="tsd-sources"><p>Inherited from EventEmitter.emit</p><ul><li>Defined in node_modules/.pnpm/@types+node@20.14.9/node_modules/@types/node/events.d.ts:859</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="eventNames" class="tsd-anchor"></a><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="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="eventNames.eventNames-1" class="tsd-anchor"></a><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="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns an array listing the events for which the emitter has registered | |
71218fcd | 87 | listeners. The values in the array are strings or <code>Symbol</code>s.</p> |
224d0081 DB |
88 | <pre><code class="js"><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-0">EventEmitter</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-5">'node:events'</span><span class="hl-2">;</span><br/><br/><span class="hl-1">const</span><span class="hl-2"> </span><span class="hl-3">myEE</span><span class="hl-2"> = </span><span class="hl-1">new</span><span class="hl-2"> </span><span class="hl-6">EventEmitter</span><span class="hl-2">();</span><br/><span class="hl-0">myEE</span><span class="hl-2">.</span><span class="hl-6">on</span><span class="hl-2">(</span><span class="hl-5">'foo'</span><span class="hl-2">, () </span><span class="hl-1">=></span><span class="hl-2"> {});</span><br/><span class="hl-0">myEE</span><span class="hl-2">.</span><span class="hl-6">on</span><span class="hl-2">(</span><span class="hl-5">'bar'</span><span class="hl-2">, () </span><span class="hl-1">=></span><span class="hl-2"> {});</span><br/><br/><span class="hl-1">const</span><span class="hl-2"> </span><span class="hl-3">sym</span><span class="hl-2"> = </span><span class="hl-6">Symbol</span><span class="hl-2">(</span><span class="hl-5">'symbol'</span><span class="hl-2">);</span><br/><span class="hl-0">myEE</span><span class="hl-2">.</span><span class="hl-6">on</span><span class="hl-2">(</span><span class="hl-0">sym</span><span class="hl-2">, () </span><span class="hl-1">=></span><span class="hl-2"> {});</span><br/><br/><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-0">myEE</span><span class="hl-2">.</span><span class="hl-6">eventNames</span><span class="hl-2">());</span><br/><span class="hl-7">// Prints: [ 'foo', 'bar', Symbol(symbol) ]</span> |
89 | </code><button type="button">Copy</button></pre> | |
90 | ||
91 | </div><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><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Since-2" class="tsd-anchor"></a>Since<a href="#Since-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>v6.0.0</p> | |
92 | </div><aside class="tsd-sources"><p>Inherited from EventEmitter.eventNames</p><ul><li>Defined in node_modules/.pnpm/@types+node@20.14.9/node_modules/@types/node/events.d.ts:922</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="getMaxListeners" class="tsd-anchor"></a><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="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="getMaxListeners.getMaxListeners-1" class="tsd-anchor"></a><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="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the current max listener value for the <code>EventEmitter</code> which is either | |
71218fcd | 93 | set by <code>emitter.setMaxListeners(n)</code> or defaults to defaultMaxListeners.</p> |
224d0081 DB |
94 | </div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Since-3" class="tsd-anchor"></a>Since<a href="#Since-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>v1.0.0</p> |
95 | </div><aside class="tsd-sources"><p>Inherited from EventEmitter.getMaxListeners</p><ul><li>Defined in node_modules/.pnpm/@types+node@20.14.9/node_modules/@types/node/events.d.ts:774</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="listenerCount" class="tsd-anchor"></a><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="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="listenerCount.listenerCount-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">listener<wbr/>Count</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#listenerCount.listenerCount-1.K-3">K</a><span class="tsd-signature-symbol">></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="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns the number of listeners listening for the event named <code>eventName</code>. | |
71218fcd DB |
96 | If <code>listener</code> is provided, it will return how many times the listener is found |
97 | in the list of the listeners of the event.</p> | |
86de0a2d | 98 | </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="listenerCount.listenerCount-1.K-3" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span><div class="tsd-comment tsd-typography"><p>The name of the event being listened for</p> |
224d0081 DB |
99 | </div><div class="tsd-comment tsd-typography"></div></li><li><span><code class="tsd-tag">Optional</code><span class="tsd-kind-parameter">listener</span>: <span class="tsd-signature-type">Function</span></span><div class="tsd-comment tsd-typography"><p>The event handler function</p> |
100 | </div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Since-4" class="tsd-anchor"></a>Since<a href="#Since-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>v3.2.0</p> | |
101 | </div><aside class="tsd-sources"><p>Inherited from EventEmitter.listenerCount</p><ul><li>Defined in node_modules/.pnpm/@types+node@20.14.9/node_modules/@types/node/events.d.ts:868</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="listeners" class="tsd-anchor"></a><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="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="listeners.listeners-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">listeners</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#listeners.listeners-1.K-4">K</a><span class="tsd-signature-symbol">></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="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a copy of the array of listeners for the event named <code>eventName</code>.</p> | |
102 | <pre><code class="js"><span class="hl-0">server</span><span class="hl-2">.</span><span class="hl-6">on</span><span class="hl-2">(</span><span class="hl-5">'connection'</span><span class="hl-2">, (</span><span class="hl-0">stream</span><span class="hl-2">) </span><span class="hl-1">=></span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">'someone connected!'</span><span class="hl-2">);</span><br/><span class="hl-2">});</span><br/><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-0">util</span><span class="hl-2">.</span><span class="hl-6">inspect</span><span class="hl-2">(</span><span class="hl-0">server</span><span class="hl-2">.</span><span class="hl-6">listeners</span><span class="hl-2">(</span><span class="hl-5">'connection'</span><span class="hl-2">)));</span><br/><span class="hl-7">// Prints: [ [Function] ]</span> | |
103 | </code><button type="button">Copy</button></pre> | |
104 | ||
105 | </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="listeners.listeners-1.K-4" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">[]</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Since-5" class="tsd-anchor"></a>Since<a href="#Since-5" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>v0.1.26</p> | |
106 | </div><aside class="tsd-sources"><p>Inherited from EventEmitter.listeners</p><ul><li>Defined in node_modules/.pnpm/@types+node@20.14.9/node_modules/@types/node/events.d.ts:787</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="off" class="tsd-anchor"></a><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="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="off.off-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">off</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#off.off-1.K-5">K</a><span class="tsd-signature-symbol">></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-type">this</span><a href="#off.off-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Alias for <code>emitter.removeListener()</code>.</p> | |
107 | </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="off.off-1.K-5" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li><li><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-kind-parameter">args</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><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><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">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></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Since-6" class="tsd-anchor"></a>Since<a href="#Since-6" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>v10.0.0</p> | |
108 | </div><aside class="tsd-sources"><p>Inherited from EventEmitter.off</p><ul><li>Defined in node_modules/.pnpm/@types+node@20.14.9/node_modules/@types/node/events.d.ts:747</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="on" class="tsd-anchor"></a><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="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="on.on-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">on</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#on.on-1.K-6">K</a><span class="tsd-signature-symbol">></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-type">this</span><a href="#on.on-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Adds the <code>listener</code> function to the end of the listeners array for the event | |
85de1563 DB |
109 | named <code>eventName</code>. No checks are made to see if the <code>listener</code> has already |
110 | been added. Multiple calls passing the same combination of <code>eventName</code> and | |
111 | <code>listener</code> will result in the <code>listener</code> being added, and called, multiple times.</p> | |
224d0081 DB |
112 | <pre><code class="js"><span class="hl-0">server</span><span class="hl-2">.</span><span class="hl-6">on</span><span class="hl-2">(</span><span class="hl-5">'connection'</span><span class="hl-2">, (</span><span class="hl-0">stream</span><span class="hl-2">) </span><span class="hl-1">=></span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">'someone connected!'</span><span class="hl-2">);</span><br/><span class="hl-2">});</span> |
113 | </code><button type="button">Copy</button></pre> | |
114 | ||
71218fcd | 115 | <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p> |
85de1563 | 116 | <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 |
71218fcd | 117 | event listener to the beginning of the listeners array.</p> |
224d0081 DB |
118 | <pre><code class="js"><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-0">EventEmitter</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-5">'node:events'</span><span class="hl-2">;</span><br/><span class="hl-1">const</span><span class="hl-2"> </span><span class="hl-3">myEE</span><span class="hl-2"> = </span><span class="hl-1">new</span><span class="hl-2"> </span><span class="hl-6">EventEmitter</span><span class="hl-2">();</span><br/><span class="hl-0">myEE</span><span class="hl-2">.</span><span class="hl-6">on</span><span class="hl-2">(</span><span class="hl-5">'foo'</span><span class="hl-2">, () </span><span class="hl-1">=></span><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">'a'</span><span class="hl-2">));</span><br/><span class="hl-0">myEE</span><span class="hl-2">.</span><span class="hl-6">prependListener</span><span class="hl-2">(</span><span class="hl-5">'foo'</span><span class="hl-2">, () </span><span class="hl-1">=></span><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">'b'</span><span class="hl-2">));</span><br/><span class="hl-0">myEE</span><span class="hl-2">.</span><span class="hl-6">emit</span><span class="hl-2">(</span><span class="hl-5">'foo'</span><span class="hl-2">);</span><br/><span class="hl-7">// Prints:</span><br/><span class="hl-7">// b</span><br/><span class="hl-7">// a</span> |
119 | </code><button type="button">Copy</button></pre> | |
120 | ||
86de0a2d | 121 | </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="on.on-1.K-6" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span><div class="tsd-comment tsd-typography"><p>The name of the event.</p> |
224d0081 DB |
122 | </div><div class="tsd-comment tsd-typography"></div></li><li><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-kind-parameter">args</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><div class="tsd-comment tsd-typography"><p>The callback function</p> |
123 | </div><div class="tsd-comment tsd-typography"></div><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><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><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">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></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Since-7" class="tsd-anchor"></a>Since<a href="#Since-7" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>v0.1.101</p> | |
124 | </div><aside class="tsd-sources"><p>Inherited from EventEmitter.on</p><ul><li>Defined in node_modules/.pnpm/@types+node@20.14.9/node_modules/@types/node/events.d.ts:629</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="once" class="tsd-anchor"></a><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="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="once.once-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">once</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#once.once-1.K-7">K</a><span class="tsd-signature-symbol">></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-type">this</span><a href="#once.once-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Adds a <strong>one-time</strong> <code>listener</code> function for the event named <code>eventName</code>. The | |
71218fcd | 125 | next time <code>eventName</code> is triggered, this listener is removed and then invoked.</p> |
224d0081 DB |
126 | <pre><code class="js"><span class="hl-0">server</span><span class="hl-2">.</span><span class="hl-6">once</span><span class="hl-2">(</span><span class="hl-5">'connection'</span><span class="hl-2">, (</span><span class="hl-0">stream</span><span class="hl-2">) </span><span class="hl-1">=></span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">'Ah, we have our first user!'</span><span class="hl-2">);</span><br/><span class="hl-2">});</span> |
127 | </code><button type="button">Copy</button></pre> | |
128 | ||
71218fcd | 129 | <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p> |
85de1563 | 130 | <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 |
71218fcd | 131 | event listener to the beginning of the listeners array.</p> |
224d0081 DB |
132 | <pre><code class="js"><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-0">EventEmitter</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-5">'node:events'</span><span class="hl-2">;</span><br/><span class="hl-1">const</span><span class="hl-2"> </span><span class="hl-3">myEE</span><span class="hl-2"> = </span><span class="hl-1">new</span><span class="hl-2"> </span><span class="hl-6">EventEmitter</span><span class="hl-2">();</span><br/><span class="hl-0">myEE</span><span class="hl-2">.</span><span class="hl-6">once</span><span class="hl-2">(</span><span class="hl-5">'foo'</span><span class="hl-2">, () </span><span class="hl-1">=></span><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">'a'</span><span class="hl-2">));</span><br/><span class="hl-0">myEE</span><span class="hl-2">.</span><span class="hl-6">prependOnceListener</span><span class="hl-2">(</span><span class="hl-5">'foo'</span><span class="hl-2">, () </span><span class="hl-1">=></span><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">'b'</span><span class="hl-2">));</span><br/><span class="hl-0">myEE</span><span class="hl-2">.</span><span class="hl-6">emit</span><span class="hl-2">(</span><span class="hl-5">'foo'</span><span class="hl-2">);</span><br/><span class="hl-7">// Prints:</span><br/><span class="hl-7">// b</span><br/><span class="hl-7">// a</span> |
133 | </code><button type="button">Copy</button></pre> | |
134 | ||
86de0a2d | 135 | </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="once.once-1.K-7" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span><div class="tsd-comment tsd-typography"><p>The name of the event.</p> |
224d0081 DB |
136 | </div><div class="tsd-comment tsd-typography"></div></li><li><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-kind-parameter">args</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><div class="tsd-comment tsd-typography"><p>The callback function</p> |
137 | </div><div class="tsd-comment tsd-typography"></div><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><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><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">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></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Since-8" class="tsd-anchor"></a>Since<a href="#Since-8" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>v0.3.0</p> | |
138 | </div><aside class="tsd-sources"><p>Inherited from EventEmitter.once</p><ul><li>Defined in node_modules/.pnpm/@types+node@20.14.9/node_modules/@types/node/events.d.ts:659</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="prependListener" class="tsd-anchor"></a><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="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="prependListener.prependListener-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">prepend<wbr/>Listener</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#prependListener.prependListener-1.K-8">K</a><span class="tsd-signature-symbol">></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-type">this</span><a href="#prependListener.prependListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Adds the <code>listener</code> function to the <em>beginning</em> of the listeners array for the | |
71218fcd | 139 | event named <code>eventName</code>. No checks are made to see if the <code>listener</code> has |
85de1563 DB |
140 | already been added. Multiple calls passing the same combination of <code>eventName</code> |
141 | and <code>listener</code> will result in the <code>listener</code> being added, and called, multiple times.</p> | |
224d0081 DB |
142 | <pre><code class="js"><span class="hl-0">server</span><span class="hl-2">.</span><span class="hl-6">prependListener</span><span class="hl-2">(</span><span class="hl-5">'connection'</span><span class="hl-2">, (</span><span class="hl-0">stream</span><span class="hl-2">) </span><span class="hl-1">=></span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">'someone connected!'</span><span class="hl-2">);</span><br/><span class="hl-2">});</span> |
143 | </code><button type="button">Copy</button></pre> | |
144 | ||
71218fcd | 145 | <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p> |
86de0a2d | 146 | </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="prependListener.prependListener-1.K-8" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span><div class="tsd-comment tsd-typography"><p>The name of the event.</p> |
224d0081 DB |
147 | </div><div class="tsd-comment tsd-typography"></div></li><li><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-kind-parameter">args</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><div class="tsd-comment tsd-typography"><p>The callback function</p> |
148 | </div><div class="tsd-comment tsd-typography"></div><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><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><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">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></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Since-9" class="tsd-anchor"></a>Since<a href="#Since-9" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>v6.0.0</p> | |
149 | </div><aside class="tsd-sources"><p>Inherited from EventEmitter.prependListener</p><ul><li>Defined in node_modules/.pnpm/@types+node@20.14.9/node_modules/@types/node/events.d.ts:886</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="prependOnceListener" class="tsd-anchor"></a><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="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="prependOnceListener.prependOnceListener-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">prepend<wbr/>Once<wbr/>Listener</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#prependOnceListener.prependOnceListener-1.K-9">K</a><span class="tsd-signature-symbol">></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-type">this</span><a href="#prependOnceListener.prependOnceListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Adds a <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 | |
71218fcd | 150 | listener is removed, and then invoked.</p> |
224d0081 DB |
151 | <pre><code class="js"><span class="hl-0">server</span><span class="hl-2">.</span><span class="hl-6">prependOnceListener</span><span class="hl-2">(</span><span class="hl-5">'connection'</span><span class="hl-2">, (</span><span class="hl-0">stream</span><span class="hl-2">) </span><span class="hl-1">=></span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">'Ah, we have our first user!'</span><span class="hl-2">);</span><br/><span class="hl-2">});</span> |
152 | </code><button type="button">Copy</button></pre> | |
153 | ||
71218fcd | 154 | <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p> |
86de0a2d | 155 | </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="prependOnceListener.prependOnceListener-1.K-9" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span><div class="tsd-comment tsd-typography"><p>The name of the event.</p> |
224d0081 DB |
156 | </div><div class="tsd-comment tsd-typography"></div></li><li><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-kind-parameter">args</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><div class="tsd-comment tsd-typography"><p>The callback function</p> |
157 | </div><div class="tsd-comment tsd-typography"></div><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><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><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">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></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Since-10" class="tsd-anchor"></a>Since<a href="#Since-10" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>v6.0.0</p> | |
158 | </div><aside class="tsd-sources"><p>Inherited from EventEmitter.prependOnceListener</p><ul><li>Defined in node_modules/.pnpm/@types+node@20.14.9/node_modules/@types/node/events.d.ts:902</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="rawListeners" class="tsd-anchor"></a><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="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="rawListeners.rawListeners-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">raw<wbr/>Listeners</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#rawListeners.rawListeners-1.K-10">K</a><span class="tsd-signature-symbol">></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="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Returns a copy of the array of listeners for the event named <code>eventName</code>, | |
71218fcd | 159 | including any wrappers (such as those created by <code>.once()</code>).</p> |
224d0081 DB |
160 | <pre><code class="js"><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-0">EventEmitter</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-5">'node:events'</span><span class="hl-2">;</span><br/><span class="hl-1">const</span><span class="hl-2"> </span><span class="hl-3">emitter</span><span class="hl-2"> = </span><span class="hl-1">new</span><span class="hl-2"> </span><span class="hl-6">EventEmitter</span><span class="hl-2">();</span><br/><span class="hl-0">emitter</span><span class="hl-2">.</span><span class="hl-6">once</span><span class="hl-2">(</span><span class="hl-5">'log'</span><span class="hl-2">, () </span><span class="hl-1">=></span><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">'log once'</span><span class="hl-2">));</span><br/><br/><span class="hl-7">// Returns a new Array with a function `onceWrapper` which has a property</span><br/><span class="hl-7">// `listener` which contains the original listener bound above</span><br/><span class="hl-1">const</span><span class="hl-2"> </span><span class="hl-3">listeners</span><span class="hl-2"> = </span><span class="hl-0">emitter</span><span class="hl-2">.</span><span class="hl-6">rawListeners</span><span class="hl-2">(</span><span class="hl-5">'log'</span><span class="hl-2">);</span><br/><span class="hl-1">const</span><span class="hl-2"> </span><span class="hl-3">logFnWrapper</span><span class="hl-2"> = </span><span class="hl-0">listeners</span><span class="hl-2">[</span><span class="hl-8">0</span><span class="hl-2">];</span><br/><br/><span class="hl-7">// Logs "log once" to the console and does not unbind the `once` event</span><br/><span class="hl-0">logFnWrapper</span><span class="hl-2">.</span><span class="hl-6">listener</span><span class="hl-2">();</span><br/><br/><span class="hl-7">// Logs "log once" to the console and removes the listener</span><br/><span class="hl-6">logFnWrapper</span><span class="hl-2">();</span><br/><br/><span class="hl-0">emitter</span><span class="hl-2">.</span><span class="hl-6">on</span><span class="hl-2">(</span><span class="hl-5">'log'</span><span class="hl-2">, () </span><span class="hl-1">=></span><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">'log persistently'</span><span class="hl-2">));</span><br/><span class="hl-7">// Will return a new Array with a single function bound by `.on()` above</span><br/><span class="hl-1">const</span><span class="hl-2"> </span><span class="hl-3">newListeners</span><span class="hl-2"> = </span><span class="hl-0">emitter</span><span class="hl-2">.</span><span class="hl-6">rawListeners</span><span class="hl-2">(</span><span class="hl-5">'log'</span><span class="hl-2">);</span><br/><br/><span class="hl-7">// Logs "log persistently" twice</span><br/><span class="hl-0">newListeners</span><span class="hl-2">[</span><span class="hl-8">0</span><span class="hl-2">]();</span><br/><span class="hl-0">emitter</span><span class="hl-2">.</span><span class="hl-6">emit</span><span class="hl-2">(</span><span class="hl-5">'log'</span><span class="hl-2">);</span> |
161 | </code><button type="button">Copy</button></pre> | |
162 | ||
163 | </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="rawListeners.rawListeners-1.K-10" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">[]</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Since-11" class="tsd-anchor"></a>Since<a href="#Since-11" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>v9.4.0</p> | |
164 | </div><aside class="tsd-sources"><p>Inherited from EventEmitter.rawListeners</p><ul><li>Defined in node_modules/.pnpm/@types+node@20.14.9/node_modules/@types/node/events.d.ts:818</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="removeAllListeners" class="tsd-anchor"></a><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="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="removeAllListeners.removeAllListeners-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove<wbr/>All<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-symbol">: </span><span class="tsd-signature-type">this</span><a href="#removeAllListeners.removeAllListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Removes all listeners, or those of the specified <code>eventName</code>.</p> | |
71218fcd DB |
165 | <p>It is bad practice to remove listeners added elsewhere in the code, |
166 | particularly when the <code>EventEmitter</code> instance was created by some other | |
167 | component or module (e.g. sockets or file streams).</p> | |
168 | <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p> | |
224d0081 DB |
169 | </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">Optional</code><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></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Since-12" class="tsd-anchor"></a>Since<a href="#Since-12" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>v0.1.26</p> |
170 | </div><aside class="tsd-sources"><p>Inherited from EventEmitter.removeAllListeners</p><ul><li>Defined in node_modules/.pnpm/@types+node@20.14.9/node_modules/@types/node/events.d.ts:758</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="removeListener" class="tsd-anchor"></a><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="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="removeListener.removeListener-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">remove<wbr/>Listener</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="IWorkerNode.html#removeListener.removeListener-1.K-11">K</a><span class="tsd-signature-symbol">></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-type">this</span><a href="#removeListener.removeListener-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Removes the specified <code>listener</code> from the listener array for the event named <code>eventName</code>.</p> | |
171 | <pre><code class="js"><span class="hl-1">const</span><span class="hl-2"> </span><span class="hl-6">callback</span><span class="hl-2"> = (</span><span class="hl-0">stream</span><span class="hl-2">) </span><span class="hl-1">=></span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">'someone connected!'</span><span class="hl-2">);</span><br/><span class="hl-2">};</span><br/><span class="hl-0">server</span><span class="hl-2">.</span><span class="hl-6">on</span><span class="hl-2">(</span><span class="hl-5">'connection'</span><span class="hl-2">, </span><span class="hl-0">callback</span><span class="hl-2">);</span><br/><span class="hl-7">// ...</span><br/><span class="hl-0">server</span><span class="hl-2">.</span><span class="hl-6">removeListener</span><span class="hl-2">(</span><span class="hl-5">'connection'</span><span class="hl-2">, </span><span class="hl-0">callback</span><span class="hl-2">);</span> | |
172 | </code><button type="button">Copy</button></pre> | |
173 | ||
71218fcd DB |
174 | <p><code>removeListener()</code> will remove, at most, one instance of a listener from the |
175 | listener array. If any single listener has been added multiple times to the | |
176 | listener array for the specified <code>eventName</code>, then <code>removeListener()</code> must be | |
177 | called multiple times to remove each instance.</p> | |
178 | <p>Once an event is emitted, all listeners attached to it at the | |
85de1563 | 179 | time 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 |
71218fcd | 180 | will not remove them from<code>emit()</code> in progress. Subsequent events behave as expected.</p> |
224d0081 DB |
181 | <pre><code class="js"><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-0">EventEmitter</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-5">'node:events'</span><span class="hl-2">;</span><br/><span class="hl-1">class</span><span class="hl-2"> </span><span class="hl-9">MyEmitter</span><span class="hl-2"> </span><span class="hl-1">extends</span><span class="hl-2"> </span><span class="hl-9">EventEmitter</span><span class="hl-2"> {}</span><br/><span class="hl-1">const</span><span class="hl-2"> </span><span class="hl-3">myEmitter</span><span class="hl-2"> = </span><span class="hl-1">new</span><span class="hl-2"> </span><span class="hl-6">MyEmitter</span><span class="hl-2">();</span><br/><br/><span class="hl-1">const</span><span class="hl-2"> </span><span class="hl-6">callbackA</span><span class="hl-2"> = () </span><span class="hl-1">=></span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">'A'</span><span class="hl-2">);</span><br/><span class="hl-2"> </span><span class="hl-0">myEmitter</span><span class="hl-2">.</span><span class="hl-6">removeListener</span><span class="hl-2">(</span><span class="hl-5">'event'</span><span class="hl-2">, </span><span class="hl-0">callbackB</span><span class="hl-2">);</span><br/><span class="hl-2">};</span><br/><br/><span class="hl-1">const</span><span class="hl-2"> </span><span class="hl-6">callbackB</span><span class="hl-2"> = () </span><span class="hl-1">=></span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">'B'</span><span class="hl-2">);</span><br/><span class="hl-2">};</span><br/><br/><span class="hl-0">myEmitter</span><span class="hl-2">.</span><span class="hl-6">on</span><span class="hl-2">(</span><span class="hl-5">'event'</span><span class="hl-2">, </span><span class="hl-0">callbackA</span><span class="hl-2">);</span><br/><br/><span class="hl-0">myEmitter</span><span class="hl-2">.</span><span class="hl-6">on</span><span class="hl-2">(</span><span class="hl-5">'event'</span><span class="hl-2">, </span><span class="hl-0">callbackB</span><span class="hl-2">);</span><br/><br/><span class="hl-7">// callbackA removes listener callbackB but it will still be called.</span><br/><span class="hl-7">// Internal listener array at time of emit [callbackA, callbackB]</span><br/><span class="hl-0">myEmitter</span><span class="hl-2">.</span><span class="hl-6">emit</span><span class="hl-2">(</span><span class="hl-5">'event'</span><span class="hl-2">);</span><br/><span class="hl-7">// Prints:</span><br/><span class="hl-7">// A</span><br/><span class="hl-7">// B</span><br/><br/><span class="hl-7">// callbackB is now removed.</span><br/><span class="hl-7">// Internal listener array [callbackA]</span><br/><span class="hl-0">myEmitter</span><span class="hl-2">.</span><span class="hl-6">emit</span><span class="hl-2">(</span><span class="hl-5">'event'</span><span class="hl-2">);</span><br/><span class="hl-7">// Prints:</span><br/><span class="hl-7">// A</span> |
182 | </code><button type="button">Copy</button></pre> | |
183 | ||
71218fcd DB |
184 | <p>Because listeners are managed using an internal array, calling this will |
185 | change the position indices of any listener registered <em>after</em> the listener | |
186 | being removed. This will not impact the order in which listeners are called, | |
187 | but it means that any copies of the listener array as returned by | |
188 | the <code>emitter.listeners()</code> method will need to be recreated.</p> | |
189 | <p>When a single function has been added as a handler multiple times for a single | |
190 | event (as in the example below), <code>removeListener()</code> will remove the most | |
224d0081 DB |
191 | recently added instance. In the example the <code>once('ping')</code> listener is removed:</p> |
192 | <pre><code class="js"><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-0">EventEmitter</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-5">'node:events'</span><span class="hl-2">;</span><br/><span class="hl-1">const</span><span class="hl-2"> </span><span class="hl-3">ee</span><span class="hl-2"> = </span><span class="hl-1">new</span><span class="hl-2"> </span><span class="hl-6">EventEmitter</span><span class="hl-2">();</span><br/><br/><span class="hl-1">function</span><span class="hl-2"> </span><span class="hl-6">pong</span><span class="hl-2">() {</span><br/><span class="hl-2"> </span><span class="hl-0">console</span><span class="hl-2">.</span><span class="hl-6">log</span><span class="hl-2">(</span><span class="hl-5">'pong'</span><span class="hl-2">);</span><br/><span class="hl-2">}</span><br/><br/><span class="hl-0">ee</span><span class="hl-2">.</span><span class="hl-6">on</span><span class="hl-2">(</span><span class="hl-5">'ping'</span><span class="hl-2">, </span><span class="hl-0">pong</span><span class="hl-2">);</span><br/><span class="hl-0">ee</span><span class="hl-2">.</span><span class="hl-6">once</span><span class="hl-2">(</span><span class="hl-5">'ping'</span><span class="hl-2">, </span><span class="hl-0">pong</span><span class="hl-2">);</span><br/><span class="hl-0">ee</span><span class="hl-2">.</span><span class="hl-6">removeListener</span><span class="hl-2">(</span><span class="hl-5">'ping'</span><span class="hl-2">, </span><span class="hl-0">pong</span><span class="hl-2">);</span><br/><br/><span class="hl-0">ee</span><span class="hl-2">.</span><span class="hl-6">emit</span><span class="hl-2">(</span><span class="hl-5">'ping'</span><span class="hl-2">);</span><br/><span class="hl-0">ee</span><span class="hl-2">.</span><span class="hl-6">emit</span><span class="hl-2">(</span><span class="hl-5">'ping'</span><span class="hl-2">);</span> | |
193 | </code><button type="button">Copy</button></pre> | |
194 | ||
71218fcd | 195 | <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p> |
224d0081 DB |
196 | </div><section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="removeListener.removeListener-1.K-11" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">K</span></span></li></ul></section><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">eventName</span>: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span></span></li><li><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-kind-parameter">args</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></span><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-is-external"><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><li class="tsd-description"><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><code class="tsd-tag">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></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Since-13" class="tsd-anchor"></a>Since<a href="#Since-13" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>v0.1.26</p> |
197 | </div><aside class="tsd-sources"><p>Inherited from EventEmitter.removeListener</p><ul><li>Defined in node_modules/.pnpm/@types+node@20.14.9/node_modules/@types/node/events.d.ts:742</li></ul></aside></li></ul></section><section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="setMaxListeners" class="tsd-anchor"></a><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="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures tsd-is-inherited tsd-is-external"><li class="tsd-signature tsd-anchor-link"><a id="setMaxListeners.setMaxListeners-1" class="tsd-anchor"></a><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-signature-type">this</span><a href="#setMaxListeners.setMaxListeners-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>By default <code>EventEmitter</code>s will print a warning if more than <code>10</code> listeners are | |
71218fcd DB |
198 | added for a particular event. This is a useful default that helps finding |
199 | memory leaks. The <code>emitter.setMaxListeners()</code> method allows the limit to be | |
85de1563 | 200 | modified 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> |
71218fcd | 201 | <p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p> |
224d0081 DB |
202 | </div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">n</span>: <span class="tsd-signature-type">number</span></span></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">this</span></h4><div class="tsd-comment tsd-typography"><h4 class="tsd-anchor-link"><a id="Since-14" class="tsd-anchor"></a>Since<a href="#Since-14" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>v0.3.5</p> |
203 | </div><aside class="tsd-sources"><p>Inherited from EventEmitter.setMaxListeners</p><ul><li>Defined in node_modules/.pnpm/@types+node@20.14.9/node_modules/@types/node/events.d.ts:768</li></ul></aside></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#clearTasksQueue" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>clear<wbr/>Tasks<wbr/>Queue</span></a><a href="#deleteTaskFunctionWorkerUsage" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>delete<wbr/>Task<wbr/>Function<wbr/>Worker<wbr/>Usage</span></a><a href="#dequeueLastPrioritizedTask" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dequeue<wbr/>Last<wbr/>Prioritized<wbr/>Task</span></a><a href="#dequeueTask" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>dequeue<wbr/>Task</span></a><a href="#enqueueTask" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>enqueue<wbr/>Task</span></a><a href="#getTaskFunctionWorkerUsage" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>get<wbr/>Task<wbr/>Function<wbr/>Worker<wbr/>Usage</span></a><a href="#hasBackPressure" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>has<wbr/>Back<wbr/>Pressure</span></a><a href="#info" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>info</span></a><a href="#messageChannel" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>message<wbr/>Channel</span></a><a href="#registerOnceWorkerEventHandler" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>register<wbr/>Once<wbr/>Worker<wbr/>Event<wbr/>Handler</span></a><a href="#registerWorkerEventHandler" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>register<wbr/>Worker<wbr/>Event<wbr/>Handler</span></a><a href="#setTasksQueuePriority" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>set<wbr/>Tasks<wbr/>Queue<wbr/>Priority</span></a><a href="#strategyData" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>strategy<wbr/>Data</span></a><a href="#tasksQueueBackPressureSize" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>tasks<wbr/>Queue<wbr/>Back<wbr/>Pressure<wbr/>Size</span></a><a href="#tasksQueueSize" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>tasks<wbr/>Queue<wbr/>Size</span></a><a href="#terminate" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>terminate</span></a><a href="#usage" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>usage</span></a><a href="#worker-1" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>worker</span></a></div></details><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#_captureRejectionSymbol_" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>[capture<wbr/>Rejection<wbr/>Symbol]</span></a><a href="#addListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>add<wbr/>Listener</span></a><a href="#emit" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>emit</span></a><a href="#eventNames" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>event<wbr/>Names</span></a><a href="#getMaxListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>get<wbr/>Max<wbr/>Listeners</span></a><a href="#listenerCount" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>listener<wbr/>Count</span></a><a href="#listeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>listeners</span></a><a href="#off" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>off</span></a><a href="#on" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>on</span></a><a href="#once" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>once</span></a><a href="#prependListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>prepend<wbr/>Listener</span></a><a href="#prependOnceListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>prepend<wbr/>Once<wbr/>Listener</span></a><a href="#rawListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>raw<wbr/>Listeners</span></a><a href="#removeAllListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>All<wbr/>Listeners</span></a><a href="#removeListener" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>remove<wbr/>Listener</span></a><a href="#setMaxListeners" class="tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>set<wbr/>Max<wbr/>Listeners</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../index.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>poolifier - v4.0.15</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html> |