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
.5</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
.5</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 ts-flagInternal">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-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-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><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-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-kind-parameter">handler
</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-kind-parameter">handler
</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-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><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-kind-parameter">listener
</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-kind-parameter">args
</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-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><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-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-kind-parameter">listener
</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-kind-parameter">listener
</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-kind-parameter">listener
</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-kind-parameter">listener
</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-kind-parameter">listener
</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-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-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-kind-parameter">listener
</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-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>
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>
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/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L285">src/pools/worker.ts:
285</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-index-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>
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>
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>
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>
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>
15 <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>
16 <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>
17 <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>
18 <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>
19 <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>
20 <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>
21 </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>
22 <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>
23 <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>
24 <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>
25 <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>
26 <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>
27 <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>
28 <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>
29 <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>
30 <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>
31 <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>
32 <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>
33 <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>
34 <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>
35 <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>
36 <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>
37 </div></section></div></details></section></section><section class=
"tsd-panel-group tsd-member-group"><h2>Properties
</h2><section class=
"tsd-panel tsd-member"><a id=
"clearTasksQueue" class=
"tsd-anchor"></a><h3 class=
"tsd-anchor-link"><code class=
"tsd-tag ts-flagReadonly">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>
38 </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=
"clearTasksQueue.__type.__type-1"><span class=
"tsd-signature-symbol">(
</span><span class=
"tsd-signature-symbol">)
</span><span class=
"tsd-signature-symbol">:
</span><span class=
"tsd-signature-type">void
</span></li><li class=
"tsd-description"><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/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L342">src/pools/worker.ts:
342</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 ts-flagReadonly">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-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>
39 </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>
40 </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></li></ul></li></ul></div><div class=
"tsd-comment tsd-typography"><h4>Returns
</h4><p><code>true
</code> if the task function worker usage statistics were deleted,
<code>false
</code> otherwise.
</p>
41 </div><aside class=
"tsd-sources"><ul><li>Defined in
<a href=
"https://github.com/poolifier/poolifier/blob/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L386">src/pools/worker.ts:
386</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 ts-flagReadonly">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>
42 </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></li></ul></li></ul></div><div class=
"tsd-comment tsd-typography"><h4>Returns
</h4><p>The dequeued task.
</p>
43 </div><aside class=
"tsd-sources"><ul><li>Defined in
<a href=
"https://github.com/poolifier/poolifier/blob/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L338">src/pools/worker.ts:
338</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 ts-flagReadonly">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-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>
44 </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 ts-flagOptional">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>
45 </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></li></ul></li></ul></div><div class=
"tsd-comment tsd-typography"><h4>Default Value
</h4><pre><code class=
"language-ts"><span class=
"hl-1">0</span>
46 </code><button>Copy
</button></pre>
47 <h4>Returns
</h4><p>The dequeued task.
</p>
48 </div><aside class=
"tsd-sources"><ul><li>Defined in
<a href=
"https://github.com/poolifier/poolifier/blob/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L332">src/pools/worker.ts:
332</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 ts-flagReadonly">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><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>
49 </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>
50 </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></li></ul></li></ul></div><div class=
"tsd-comment tsd-typography"><h4>Returns
</h4><p>The tasks queue size.
</p>
51 </div><aside class=
"tsd-sources"><ul><li>Defined in
<a href=
"https://github.com/poolifier/poolifier/blob/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L325">src/pools/worker.ts:
325</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 ts-flagReadonly">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-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>
52 </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>
53 </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></li></ul></li></ul></div><div class=
"tsd-comment tsd-typography"><h4>Returns
</h4><p>The task function worker usage statistics if the task function worker usage statistics are initialized,
<code>undefined
</code> otherwise.
</p>
54 </div><aside class=
"tsd-sources"><ul><li>Defined in
<a href=
"https://github.com/poolifier/poolifier/blob/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L379">src/pools/worker.ts:
379</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 ts-flagReadonly">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>
55 </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></li></ul></li></ul></div><div class=
"tsd-comment tsd-typography"><h4>Returns
</h4><p><code>true
</code> if the worker node has back pressure,
<code>false
</code> otherwise.
</p>
56 </div><aside class=
"tsd-sources"><ul><li>Defined in
<a href=
"https://github.com/poolifier/poolifier/blob/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L348">src/pools/worker.ts:
348</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 ts-flagReadonly">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>
57 </div><div class=
"tsd-comment tsd-typography"></div><aside class=
"tsd-sources"><ul><li>Defined in
<a href=
"https://github.com/poolifier/poolifier/blob/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L294">src/pools/worker.ts:
294</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 ts-flagOptional">Optional
</code> <code class=
"tsd-tag ts-flagReadonly">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>
58 </div><div class=
"tsd-comment tsd-typography"></div><aside class=
"tsd-sources"><ul><li>Defined in
<a href=
"https://github.com/poolifier/poolifier/blob/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L307">src/pools/worker.ts:
307</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 ts-flagReadonly">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-kind-parameter">handler
</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>
59 </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>
60 </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>
61 </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/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L369">src/pools/worker.ts:
369</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 ts-flagReadonly">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-kind-parameter">handler
</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>
62 </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>
63 </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>
64 </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/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L359">src/pools/worker.ts:
359</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 ts-flagOptional">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.
65 This is used to store data that are specific to the worker choice strategy.
</p>
66 </div><div class=
"tsd-comment tsd-typography"></div><aside class=
"tsd-sources"><ul><li>Defined in
<a href=
"https://github.com/poolifier/poolifier/blob/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L303">src/pools/worker.ts:
303</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.
67 This is the number of tasks that can be enqueued before the worker node has back pressure.
</p>
68 </div><div class=
"tsd-comment tsd-typography"></div><aside class=
"tsd-sources"><ul><li>Defined in
<a href=
"https://github.com/poolifier/poolifier/blob/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L312">src/pools/worker.ts:
312</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 ts-flagReadonly">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>
69 </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-18.__type-19"><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></li></ul></li></ul></div><div class=
"tsd-comment tsd-typography"><h4>Returns
</h4><p>The tasks queue size.
</p>
70 </div><aside class=
"tsd-sources"><ul><li>Defined in
<a href=
"https://github.com/poolifier/poolifier/blob/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L318">src/pools/worker.ts:
318</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 ts-flagReadonly">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>
71 </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=
"terminate.__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">Promise
</span><span class=
"tsd-signature-symbol"><</span><span class=
"tsd-signature-type">void
</span><span class=
"tsd-signature-symbol">></span></li><li class=
"tsd-description"><h4 class=
"tsd-returns-title">Returns
<span class=
"tsd-signature-type">Promise
</span><span class=
"tsd-signature-symbol"><</span><span class=
"tsd-signature-type">void
</span><span class=
"tsd-signature-symbol">></span></h4></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/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L352">src/pools/worker.ts:
352</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 ts-flagReadonly">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>
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/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L298">src/pools/worker.ts:
298</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 ts-flagReadonly">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>
73 </div><div class=
"tsd-comment tsd-typography"></div><aside class=
"tsd-sources"><ul><li>Defined in
<a href=
"https://github.com/poolifier/poolifier/blob/7cdb9e56d90588cb96d1b38e916afa268b3c928f/src/pools/worker.ts#L290">src/pools/worker.ts:
290</a></li></ul></aside></section></section><section class=
"tsd-panel-group tsd-member-group"><h2>Methods
</h2><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 ts-flagOptional">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 ts-flagRest">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.12.11/node_modules/@types/node/events.d.ts:
115</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>
74 </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-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 ts-flagRest">Rest
</code> <span class=
"tsd-signature-symbol">...
</span><span class=
"tsd-kind-parameter">args
</span>:
<span class=
"tsd-signature-type">any
</span><span class=
"tsd-signature-symbol">[]
</span></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>Since
</h4><p>v0.1
.26</p>
75 </div><aside class=
"tsd-sources"><p>Inherited from EventEmitter.addListener
</p><ul><li>Defined in node_modules/.pnpm/@types+node@
20.12.11/node_modules/@types/node/events.d.ts:
550</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
77 <p>Returns
<code>true
</code> if the event had listeners,
<code>false
</code> otherwise.
</p>
78 <pre><code class=
"language-js"><span class=
"hl-6">import
</span><span class=
"hl-0"> {
</span><span class=
"hl-3">EventEmitter
</span><span class=
"hl-0"> }
</span><span class=
"hl-6">from
</span><span class=
"hl-0"> </span><span class=
"hl-7">'node:events
'</span><span class=
"hl-0">;
</span><br/><span class=
"hl-4">const
</span><span class=
"hl-0"> </span><span class=
"hl-5">myEmitter
</span><span class=
"hl-0"> =
</span><span class=
"hl-4">new
</span><span class=
"hl-0"> </span><span class=
"hl-2">EventEmitter
</span><span class=
"hl-0">();
</span><br/><br/><span class=
"hl-8">// First listener
</span><br/><span class=
"hl-3">myEmitter
</span><span class=
"hl-0">.
</span><span class=
"hl-2">on
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'event
'</span><span class=
"hl-0">,
</span><span class=
"hl-4">function
</span><span class=
"hl-0"> </span><span class=
"hl-2">firstListener
</span><span class=
"hl-0">() {
</span><br/><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'Helloooo! first listener
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-0">});
</span><br/><span class=
"hl-8">// Second listener
</span><br/><span class=
"hl-3">myEmitter
</span><span class=
"hl-0">.
</span><span class=
"hl-2">on
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'event
'</span><span class=
"hl-0">,
</span><span class=
"hl-4">function
</span><span class=
"hl-0"> </span><span class=
"hl-2">secondListener
</span><span class=
"hl-0">(
</span><span class=
"hl-3">arg1
</span><span class=
"hl-0">,
</span><span class=
"hl-3">arg2
</span><span class=
"hl-0">) {
</span><br/><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">`event with parameters
</span><span class=
"hl-4">${
</span><span class=
"hl-3">arg1
</span><span class=
"hl-4">}
</span><span class=
"hl-7">,
</span><span class=
"hl-4">${
</span><span class=
"hl-3">arg2
</span><span class=
"hl-4">}
</span><span class=
"hl-7"> in second listener`
</span><span class=
"hl-0">);
</span><br/><span class=
"hl-0">});
</span><br/><span class=
"hl-8">// Third listener
</span><br/><span class=
"hl-3">myEmitter
</span><span class=
"hl-0">.
</span><span class=
"hl-2">on
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'event
'</span><span class=
"hl-0">,
</span><span class=
"hl-4">function
</span><span class=
"hl-0"> </span><span class=
"hl-2">thirdListener
</span><span class=
"hl-0">(...
</span><span class=
"hl-3">args
</span><span class=
"hl-0">) {
</span><br/><span class=
"hl-0"> </span><span class=
"hl-4">const
</span><span class=
"hl-0"> </span><span class=
"hl-5">parameters
</span><span class=
"hl-0"> =
</span><span class=
"hl-3">args
</span><span class=
"hl-0">.
</span><span class=
"hl-2">join
</span><span class=
"hl-0">(
</span><span class=
"hl-7">',
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">`event with parameters
</span><span class=
"hl-4">${
</span><span class=
"hl-3">parameters
</span><span class=
"hl-4">}
</span><span class=
"hl-7"> in third listener`
</span><span class=
"hl-0">);
</span><br/><span class=
"hl-0">});
</span><br/><br/><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-3">myEmitter
</span><span class=
"hl-0">.
</span><span class=
"hl-2">listeners
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'event
'</span><span class=
"hl-0">));
</span><br/><br/><span class=
"hl-3">myEmitter
</span><span class=
"hl-0">.
</span><span class=
"hl-2">emit
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'event
'</span><span class=
"hl-0">,
</span><span class=
"hl-1">1</span><span class=
"hl-0">,
</span><span class=
"hl-1">2</span><span class=
"hl-0">,
</span><span class=
"hl-1">3</span><span class=
"hl-0">,
</span><span class=
"hl-1">4</span><span class=
"hl-0">,
</span><span class=
"hl-1">5</span><span class=
"hl-0">);
</span><br/><br/><span class=
"hl-8">// Prints:
</span><br/><span class=
"hl-8">// [
</span><br/><span class=
"hl-8">// [Function: firstListener],
</span><br/><span class=
"hl-8">// [Function: secondListener],
</span><br/><span class=
"hl-8">// [Function: thirdListener]
</span><br/><span class=
"hl-8">// ]
</span><br/><span class=
"hl-8">// Helloooo! first listener
</span><br/><span class=
"hl-8">// event with parameters
1,
2 in second listener
</span><br/><span class=
"hl-8">// event with parameters
1,
2,
3,
4,
5 in third listener
</span>
79 </code><button>Copy
</button></pre>
80 </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 ts-flagRest">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>Since
</h4><p>v0.1
.26</p>
81 </div><aside class=
"tsd-sources"><p>Inherited from EventEmitter.emit
</p><ul><li>Defined in node_modules/.pnpm/@types+node@
20.12.11/node_modules/@types/node/events.d.ts:
812</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
82 listeners. The values in the array are strings or
<code>Symbol
</code>s.
</p>
83 <pre><code class=
"language-js"><span class=
"hl-6">import
</span><span class=
"hl-0"> {
</span><span class=
"hl-3">EventEmitter
</span><span class=
"hl-0"> }
</span><span class=
"hl-6">from
</span><span class=
"hl-0"> </span><span class=
"hl-7">'node:events
'</span><span class=
"hl-0">;
</span><br/><br/><span class=
"hl-4">const
</span><span class=
"hl-0"> </span><span class=
"hl-5">myEE
</span><span class=
"hl-0"> =
</span><span class=
"hl-4">new
</span><span class=
"hl-0"> </span><span class=
"hl-2">EventEmitter
</span><span class=
"hl-0">();
</span><br/><span class=
"hl-3">myEE
</span><span class=
"hl-0">.
</span><span class=
"hl-2">on
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'foo
'</span><span class=
"hl-0">, ()
</span><span class=
"hl-4">=
></span><span class=
"hl-0"> {});
</span><br/><span class=
"hl-3">myEE
</span><span class=
"hl-0">.
</span><span class=
"hl-2">on
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'bar
'</span><span class=
"hl-0">, ()
</span><span class=
"hl-4">=
></span><span class=
"hl-0"> {});
</span><br/><br/><span class=
"hl-4">const
</span><span class=
"hl-0"> </span><span class=
"hl-5">sym
</span><span class=
"hl-0"> =
</span><span class=
"hl-2">Symbol
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'symbol
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-3">myEE
</span><span class=
"hl-0">.
</span><span class=
"hl-2">on
</span><span class=
"hl-0">(
</span><span class=
"hl-3">sym
</span><span class=
"hl-0">, ()
</span><span class=
"hl-4">=
></span><span class=
"hl-0"> {});
</span><br/><br/><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-3">myEE
</span><span class=
"hl-0">.
</span><span class=
"hl-2">eventNames
</span><span class=
"hl-0">());
</span><br/><span class=
"hl-8">// Prints: [
'foo
',
'bar
', Symbol(symbol) ]
</span>
84 </code><button>Copy
</button></pre>
85 </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>Since
</h4><p>v6.0
.0</p>
86 </div><aside class=
"tsd-sources"><p>Inherited from EventEmitter.eventNames
</p><ul><li>Defined in node_modules/.pnpm/@types+node@
20.12.11/node_modules/@types/node/events.d.ts:
875</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
87 set by
<code>emitter.setMaxListeners(n)
</code> or defaults to defaultMaxListeners.
</p>
88 </div><h4 class=
"tsd-returns-title">Returns
<span class=
"tsd-signature-type">number
</span></h4><div class=
"tsd-comment tsd-typography"><h4>Since
</h4><p>v1.0
.0</p>
89 </div><aside class=
"tsd-sources"><p>Inherited from EventEmitter.getMaxListeners
</p><ul><li>Defined in node_modules/.pnpm/@types+node@
20.12.11/node_modules/@types/node/events.d.ts:
727</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>.
90 If
<code>listener
</code> is provided, it will return how many times the listener is found
91 in the list of the listeners of the event.
</p>
92 </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>
93 </div><div class=
"tsd-comment tsd-typography"></div></li><li><span><code class=
"tsd-tag ts-flagOptional">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>
94 </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>Since
</h4><p>v3.2
.0</p>
95 </div><aside class=
"tsd-sources"><p>Inherited from EventEmitter.listenerCount
</p><ul><li>Defined in node_modules/.pnpm/@types+node@
20.12.11/node_modules/@types/node/events.d.ts:
821</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>
96 <pre><code class=
"language-js"><span class=
"hl-3">server
</span><span class=
"hl-0">.
</span><span class=
"hl-2">on
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'connection
'</span><span class=
"hl-0">, (
</span><span class=
"hl-3">stream
</span><span class=
"hl-0">)
</span><span class=
"hl-4">=
></span><span class=
"hl-0"> {
</span><br/><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'someone connected!
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-0">});
</span><br/><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-3">util
</span><span class=
"hl-0">.
</span><span class=
"hl-2">inspect
</span><span class=
"hl-0">(
</span><span class=
"hl-3">server
</span><span class=
"hl-0">.
</span><span class=
"hl-2">listeners
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'connection
'</span><span class=
"hl-0">)));
</span><br/><span class=
"hl-8">// Prints: [ [Function] ]
</span>
97 </code><button>Copy
</button></pre>
98 </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>Since
</h4><p>v0.1
.26</p>
99 </div><aside class=
"tsd-sources"><p>Inherited from EventEmitter.listeners
</p><ul><li>Defined in node_modules/.pnpm/@types+node@
20.12.11/node_modules/@types/node/events.d.ts:
740</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>
100 </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-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 ts-flagRest">Rest
</code> <span class=
"tsd-signature-symbol">...
</span><span class=
"tsd-kind-parameter">args
</span>:
<span class=
"tsd-signature-type">any
</span><span class=
"tsd-signature-symbol">[]
</span></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>Since
</h4><p>v10.0
.0</p>
101 </div><aside class=
"tsd-sources"><p>Inherited from EventEmitter.off
</p><ul><li>Defined in node_modules/.pnpm/@types+node@
20.12.11/node_modules/@types/node/events.d.ts:
700</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
102 named
<code>eventName
</code>. No checks are made to see if the
<code>listener
</code> has already
103 been added. Multiple calls passing the same combination of
<code>eventName
</code> and
104 <code>listener
</code> will result in the
<code>listener
</code> being added, and called, multiple times.
</p>
105 <pre><code class=
"language-js"><span class=
"hl-3">server
</span><span class=
"hl-0">.
</span><span class=
"hl-2">on
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'connection
'</span><span class=
"hl-0">, (
</span><span class=
"hl-3">stream
</span><span class=
"hl-0">)
</span><span class=
"hl-4">=
></span><span class=
"hl-0"> {
</span><br/><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'someone connected!
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-0">});
</span>
106 </code><button>Copy
</button></pre>
107 <p>Returns a reference to the
<code>EventEmitter
</code>, so that calls can be chained.
</p>
108 <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
109 event listener to the beginning of the listeners array.
</p>
110 <pre><code class=
"language-js"><span class=
"hl-6">import
</span><span class=
"hl-0"> {
</span><span class=
"hl-3">EventEmitter
</span><span class=
"hl-0"> }
</span><span class=
"hl-6">from
</span><span class=
"hl-0"> </span><span class=
"hl-7">'node:events
'</span><span class=
"hl-0">;
</span><br/><span class=
"hl-4">const
</span><span class=
"hl-0"> </span><span class=
"hl-5">myEE
</span><span class=
"hl-0"> =
</span><span class=
"hl-4">new
</span><span class=
"hl-0"> </span><span class=
"hl-2">EventEmitter
</span><span class=
"hl-0">();
</span><br/><span class=
"hl-3">myEE
</span><span class=
"hl-0">.
</span><span class=
"hl-2">on
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'foo
'</span><span class=
"hl-0">, ()
</span><span class=
"hl-4">=
></span><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'a
'</span><span class=
"hl-0">));
</span><br/><span class=
"hl-3">myEE
</span><span class=
"hl-0">.
</span><span class=
"hl-2">prependListener
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'foo
'</span><span class=
"hl-0">, ()
</span><span class=
"hl-4">=
></span><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'b
'</span><span class=
"hl-0">));
</span><br/><span class=
"hl-3">myEE
</span><span class=
"hl-0">.
</span><span class=
"hl-2">emit
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'foo
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-8">// Prints:
</span><br/><span class=
"hl-8">// b
</span><br/><span class=
"hl-8">// a
</span>
111 </code><button>Copy
</button></pre>
112 </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>
113 </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-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>
114 </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 ts-flagRest">Rest
</code> <span class=
"tsd-signature-symbol">...
</span><span class=
"tsd-kind-parameter">args
</span>:
<span class=
"tsd-signature-type">any
</span><span class=
"tsd-signature-symbol">[]
</span></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>Since
</h4><p>v0.1
.101</p>
115 </div><aside class=
"tsd-sources"><p>Inherited from EventEmitter.on
</p><ul><li>Defined in node_modules/.pnpm/@types+node@
20.12.11/node_modules/@types/node/events.d.ts:
582</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
116 next time
<code>eventName
</code> is triggered, this listener is removed and then invoked.
</p>
117 <pre><code class=
"language-js"><span class=
"hl-3">server
</span><span class=
"hl-0">.
</span><span class=
"hl-2">once
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'connection
'</span><span class=
"hl-0">, (
</span><span class=
"hl-3">stream
</span><span class=
"hl-0">)
</span><span class=
"hl-4">=
></span><span class=
"hl-0"> {
</span><br/><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'Ah, we have our first user!
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-0">});
</span>
118 </code><button>Copy
</button></pre>
119 <p>Returns a reference to the
<code>EventEmitter
</code>, so that calls can be chained.
</p>
120 <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
121 event listener to the beginning of the listeners array.
</p>
122 <pre><code class=
"language-js"><span class=
"hl-6">import
</span><span class=
"hl-0"> {
</span><span class=
"hl-3">EventEmitter
</span><span class=
"hl-0"> }
</span><span class=
"hl-6">from
</span><span class=
"hl-0"> </span><span class=
"hl-7">'node:events
'</span><span class=
"hl-0">;
</span><br/><span class=
"hl-4">const
</span><span class=
"hl-0"> </span><span class=
"hl-5">myEE
</span><span class=
"hl-0"> =
</span><span class=
"hl-4">new
</span><span class=
"hl-0"> </span><span class=
"hl-2">EventEmitter
</span><span class=
"hl-0">();
</span><br/><span class=
"hl-3">myEE
</span><span class=
"hl-0">.
</span><span class=
"hl-2">once
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'foo
'</span><span class=
"hl-0">, ()
</span><span class=
"hl-4">=
></span><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'a
'</span><span class=
"hl-0">));
</span><br/><span class=
"hl-3">myEE
</span><span class=
"hl-0">.
</span><span class=
"hl-2">prependOnceListener
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'foo
'</span><span class=
"hl-0">, ()
</span><span class=
"hl-4">=
></span><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'b
'</span><span class=
"hl-0">));
</span><br/><span class=
"hl-3">myEE
</span><span class=
"hl-0">.
</span><span class=
"hl-2">emit
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'foo
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-8">// Prints:
</span><br/><span class=
"hl-8">// b
</span><br/><span class=
"hl-8">// a
</span>
123 </code><button>Copy
</button></pre>
124 </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>
125 </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-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>
126 </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 ts-flagRest">Rest
</code> <span class=
"tsd-signature-symbol">...
</span><span class=
"tsd-kind-parameter">args
</span>:
<span class=
"tsd-signature-type">any
</span><span class=
"tsd-signature-symbol">[]
</span></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>Since
</h4><p>v0.3
.0</p>
127 </div><aside class=
"tsd-sources"><p>Inherited from EventEmitter.once
</p><ul><li>Defined in node_modules/.pnpm/@types+node@
20.12.11/node_modules/@types/node/events.d.ts:
612</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
128 event named
<code>eventName
</code>. No checks are made to see if the
<code>listener
</code> has
129 already been added. Multiple calls passing the same combination of
<code>eventName
</code>
130 and
<code>listener
</code> will result in the
<code>listener
</code> being added, and called, multiple times.
</p>
131 <pre><code class=
"language-js"><span class=
"hl-3">server
</span><span class=
"hl-0">.
</span><span class=
"hl-2">prependListener
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'connection
'</span><span class=
"hl-0">, (
</span><span class=
"hl-3">stream
</span><span class=
"hl-0">)
</span><span class=
"hl-4">=
></span><span class=
"hl-0"> {
</span><br/><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'someone connected!
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-0">});
</span>
132 </code><button>Copy
</button></pre>
133 <p>Returns a reference to the
<code>EventEmitter
</code>, so that calls can be chained.
</p>
134 </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>
135 </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-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>
136 </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 ts-flagRest">Rest
</code> <span class=
"tsd-signature-symbol">...
</span><span class=
"tsd-kind-parameter">args
</span>:
<span class=
"tsd-signature-type">any
</span><span class=
"tsd-signature-symbol">[]
</span></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>Since
</h4><p>v6.0
.0</p>
137 </div><aside class=
"tsd-sources"><p>Inherited from EventEmitter.prependListener
</p><ul><li>Defined in node_modules/.pnpm/@types+node@
20.12.11/node_modules/@types/node/events.d.ts:
839</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
138 listener is removed, and then invoked.
</p>
139 <pre><code class=
"language-js"><span class=
"hl-3">server
</span><span class=
"hl-0">.
</span><span class=
"hl-2">prependOnceListener
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'connection
'</span><span class=
"hl-0">, (
</span><span class=
"hl-3">stream
</span><span class=
"hl-0">)
</span><span class=
"hl-4">=
></span><span class=
"hl-0"> {
</span><br/><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'Ah, we have our first user!
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-0">});
</span>
140 </code><button>Copy
</button></pre>
141 <p>Returns a reference to the
<code>EventEmitter
</code>, so that calls can be chained.
</p>
142 </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>
143 </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-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>
144 </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 ts-flagRest">Rest
</code> <span class=
"tsd-signature-symbol">...
</span><span class=
"tsd-kind-parameter">args
</span>:
<span class=
"tsd-signature-type">any
</span><span class=
"tsd-signature-symbol">[]
</span></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>Since
</h4><p>v6.0
.0</p>
145 </div><aside class=
"tsd-sources"><p>Inherited from EventEmitter.prependOnceListener
</p><ul><li>Defined in node_modules/.pnpm/@types+node@
20.12.11/node_modules/@types/node/events.d.ts:
855</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>,
146 including any wrappers (such as those created by
<code>.once()
</code>).
</p>
147 <pre><code class=
"language-js"><span class=
"hl-6">import
</span><span class=
"hl-0"> {
</span><span class=
"hl-3">EventEmitter
</span><span class=
"hl-0"> }
</span><span class=
"hl-6">from
</span><span class=
"hl-0"> </span><span class=
"hl-7">'node:events
'</span><span class=
"hl-0">;
</span><br/><span class=
"hl-4">const
</span><span class=
"hl-0"> </span><span class=
"hl-5">emitter
</span><span class=
"hl-0"> =
</span><span class=
"hl-4">new
</span><span class=
"hl-0"> </span><span class=
"hl-2">EventEmitter
</span><span class=
"hl-0">();
</span><br/><span class=
"hl-3">emitter
</span><span class=
"hl-0">.
</span><span class=
"hl-2">once
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'log
'</span><span class=
"hl-0">, ()
</span><span class=
"hl-4">=
></span><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'log once
'</span><span class=
"hl-0">));
</span><br/><br/><span class=
"hl-8">// Returns a new Array with a function `onceWrapper` which has a property
</span><br/><span class=
"hl-8">// `listener` which contains the original listener bound above
</span><br/><span class=
"hl-4">const
</span><span class=
"hl-0"> </span><span class=
"hl-5">listeners
</span><span class=
"hl-0"> =
</span><span class=
"hl-3">emitter
</span><span class=
"hl-0">.
</span><span class=
"hl-2">rawListeners
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'log
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-4">const
</span><span class=
"hl-0"> </span><span class=
"hl-5">logFnWrapper
</span><span class=
"hl-0"> =
</span><span class=
"hl-3">listeners
</span><span class=
"hl-0">[
</span><span class=
"hl-1">0</span><span class=
"hl-0">];
</span><br/><br/><span class=
"hl-8">// Logs
"log once
" to the console and does not unbind the `once` event
</span><br/><span class=
"hl-3">logFnWrapper
</span><span class=
"hl-0">.
</span><span class=
"hl-2">listener
</span><span class=
"hl-0">();
</span><br/><br/><span class=
"hl-8">// Logs
"log once
" to the console and removes the listener
</span><br/><span class=
"hl-2">logFnWrapper
</span><span class=
"hl-0">();
</span><br/><br/><span class=
"hl-3">emitter
</span><span class=
"hl-0">.
</span><span class=
"hl-2">on
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'log
'</span><span class=
"hl-0">, ()
</span><span class=
"hl-4">=
></span><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'log persistently
'</span><span class=
"hl-0">));
</span><br/><span class=
"hl-8">// Will return a new Array with a single function bound by `.on()` above
</span><br/><span class=
"hl-4">const
</span><span class=
"hl-0"> </span><span class=
"hl-5">newListeners
</span><span class=
"hl-0"> =
</span><span class=
"hl-3">emitter
</span><span class=
"hl-0">.
</span><span class=
"hl-2">rawListeners
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'log
'</span><span class=
"hl-0">);
</span><br/><br/><span class=
"hl-8">// Logs
"log persistently
" twice
</span><br/><span class=
"hl-3">newListeners
</span><span class=
"hl-0">[
</span><span class=
"hl-1">0</span><span class=
"hl-0">]();
</span><br/><span class=
"hl-3">emitter
</span><span class=
"hl-0">.
</span><span class=
"hl-2">emit
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'log
'</span><span class=
"hl-0">);
</span>
148 </code><button>Copy
</button></pre>
149 </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>Since
</h4><p>v9.4
.0</p>
150 </div><aside class=
"tsd-sources"><p>Inherited from EventEmitter.rawListeners
</p><ul><li>Defined in node_modules/.pnpm/@types+node@
20.12.11/node_modules/@types/node/events.d.ts:
771</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>
151 <p>It is bad practice to remove listeners added elsewhere in the code,
152 particularly when the
<code>EventEmitter
</code> instance was created by some other
153 component or module (e.g. sockets or file streams).
</p>
154 <p>Returns a reference to the
<code>EventEmitter
</code>, so that calls can be chained.
</p>
155 </div><div class=
"tsd-parameters"><h4 class=
"tsd-parameters-title">Parameters
</h4><ul class=
"tsd-parameter-list"><li><span><code class=
"tsd-tag ts-flagOptional">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>Since
</h4><p>v0.1
.26</p>
156 </div><aside class=
"tsd-sources"><p>Inherited from EventEmitter.removeAllListeners
</p><ul><li>Defined in node_modules/.pnpm/@types+node@
20.12.11/node_modules/@types/node/events.d.ts:
711</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>
157 <pre><code class=
"language-js"><span class=
"hl-4">const
</span><span class=
"hl-0"> </span><span class=
"hl-2">callback
</span><span class=
"hl-0"> = (
</span><span class=
"hl-3">stream
</span><span class=
"hl-0">)
</span><span class=
"hl-4">=
></span><span class=
"hl-0"> {
</span><br/><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'someone connected!
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-0">};
</span><br/><span class=
"hl-3">server
</span><span class=
"hl-0">.
</span><span class=
"hl-2">on
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'connection
'</span><span class=
"hl-0">,
</span><span class=
"hl-3">callback
</span><span class=
"hl-0">);
</span><br/><span class=
"hl-8">// ...
</span><br/><span class=
"hl-3">server
</span><span class=
"hl-0">.
</span><span class=
"hl-2">removeListener
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'connection
'</span><span class=
"hl-0">,
</span><span class=
"hl-3">callback
</span><span class=
"hl-0">);
</span>
158 </code><button>Copy
</button></pre>
159 <p><code>removeListener()
</code> will remove, at most, one instance of a listener from the
160 listener array. If any single listener has been added multiple times to the
161 listener array for the specified
<code>eventName
</code>, then
<code>removeListener()
</code> must be
162 called multiple times to remove each instance.
</p>
163 <p>Once an event is emitted, all listeners attached to it at the
164 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
165 will not remove them from
<code>emit()
</code> in progress. Subsequent events behave as expected.
</p>
166 <pre><code class=
"language-js"><span class=
"hl-6">import
</span><span class=
"hl-0"> {
</span><span class=
"hl-3">EventEmitter
</span><span class=
"hl-0"> }
</span><span class=
"hl-6">from
</span><span class=
"hl-0"> </span><span class=
"hl-7">'node:events
'</span><span class=
"hl-0">;
</span><br/><span class=
"hl-4">class
</span><span class=
"hl-0"> </span><span class=
"hl-9">MyEmitter
</span><span class=
"hl-0"> </span><span class=
"hl-4">extends
</span><span class=
"hl-0"> </span><span class=
"hl-9">EventEmitter
</span><span class=
"hl-0"> {}
</span><br/><span class=
"hl-4">const
</span><span class=
"hl-0"> </span><span class=
"hl-5">myEmitter
</span><span class=
"hl-0"> =
</span><span class=
"hl-4">new
</span><span class=
"hl-0"> </span><span class=
"hl-2">MyEmitter
</span><span class=
"hl-0">();
</span><br/><br/><span class=
"hl-4">const
</span><span class=
"hl-0"> </span><span class=
"hl-2">callbackA
</span><span class=
"hl-0"> = ()
</span><span class=
"hl-4">=
></span><span class=
"hl-0"> {
</span><br/><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'A
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-0"> </span><span class=
"hl-3">myEmitter
</span><span class=
"hl-0">.
</span><span class=
"hl-2">removeListener
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'event
'</span><span class=
"hl-0">,
</span><span class=
"hl-3">callbackB
</span><span class=
"hl-0">);
</span><br/><span class=
"hl-0">};
</span><br/><br/><span class=
"hl-4">const
</span><span class=
"hl-0"> </span><span class=
"hl-2">callbackB
</span><span class=
"hl-0"> = ()
</span><span class=
"hl-4">=
></span><span class=
"hl-0"> {
</span><br/><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'B
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-0">};
</span><br/><br/><span class=
"hl-3">myEmitter
</span><span class=
"hl-0">.
</span><span class=
"hl-2">on
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'event
'</span><span class=
"hl-0">,
</span><span class=
"hl-3">callbackA
</span><span class=
"hl-0">);
</span><br/><br/><span class=
"hl-3">myEmitter
</span><span class=
"hl-0">.
</span><span class=
"hl-2">on
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'event
'</span><span class=
"hl-0">,
</span><span class=
"hl-3">callbackB
</span><span class=
"hl-0">);
</span><br/><br/><span class=
"hl-8">// callbackA removes listener callbackB but it will still be called.
</span><br/><span class=
"hl-8">// Internal listener array at time of emit [callbackA, callbackB]
</span><br/><span class=
"hl-3">myEmitter
</span><span class=
"hl-0">.
</span><span class=
"hl-2">emit
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'event
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-8">// Prints:
</span><br/><span class=
"hl-8">// A
</span><br/><span class=
"hl-8">// B
</span><br/><br/><span class=
"hl-8">// callbackB is now removed.
</span><br/><span class=
"hl-8">// Internal listener array [callbackA]
</span><br/><span class=
"hl-3">myEmitter
</span><span class=
"hl-0">.
</span><span class=
"hl-2">emit
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'event
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-8">// Prints:
</span><br/><span class=
"hl-8">// A
</span>
167 </code><button>Copy
</button></pre>
168 <p>Because listeners are managed using an internal array, calling this will
169 change the position indices of any listener registered
<em>after
</em> the listener
170 being removed. This will not impact the order in which listeners are called,
171 but it means that any copies of the listener array as returned by
172 the
<code>emitter.listeners()
</code> method will need to be recreated.
</p>
173 <p>When a single function has been added as a handler multiple times for a single
174 event (as in the example below),
<code>removeListener()
</code> will remove the most
175 recently added instance. In the example the
<code>once(
'ping
')
</code> listener is removed:
</p>
176 <pre><code class=
"language-js"><span class=
"hl-6">import
</span><span class=
"hl-0"> {
</span><span class=
"hl-3">EventEmitter
</span><span class=
"hl-0"> }
</span><span class=
"hl-6">from
</span><span class=
"hl-0"> </span><span class=
"hl-7">'node:events
'</span><span class=
"hl-0">;
</span><br/><span class=
"hl-4">const
</span><span class=
"hl-0"> </span><span class=
"hl-5">ee
</span><span class=
"hl-0"> =
</span><span class=
"hl-4">new
</span><span class=
"hl-0"> </span><span class=
"hl-2">EventEmitter
</span><span class=
"hl-0">();
</span><br/><br/><span class=
"hl-4">function
</span><span class=
"hl-0"> </span><span class=
"hl-2">pong
</span><span class=
"hl-0">() {
</span><br/><span class=
"hl-0"> </span><span class=
"hl-3">console
</span><span class=
"hl-0">.
</span><span class=
"hl-2">log
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'pong
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-0">}
</span><br/><br/><span class=
"hl-3">ee
</span><span class=
"hl-0">.
</span><span class=
"hl-2">on
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'ping
'</span><span class=
"hl-0">,
</span><span class=
"hl-3">pong
</span><span class=
"hl-0">);
</span><br/><span class=
"hl-3">ee
</span><span class=
"hl-0">.
</span><span class=
"hl-2">once
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'ping
'</span><span class=
"hl-0">,
</span><span class=
"hl-3">pong
</span><span class=
"hl-0">);
</span><br/><span class=
"hl-3">ee
</span><span class=
"hl-0">.
</span><span class=
"hl-2">removeListener
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'ping
'</span><span class=
"hl-0">,
</span><span class=
"hl-3">pong
</span><span class=
"hl-0">);
</span><br/><br/><span class=
"hl-3">ee
</span><span class=
"hl-0">.
</span><span class=
"hl-2">emit
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'ping
'</span><span class=
"hl-0">);
</span><br/><span class=
"hl-3">ee
</span><span class=
"hl-0">.
</span><span class=
"hl-2">emit
</span><span class=
"hl-0">(
</span><span class=
"hl-7">'ping
'</span><span class=
"hl-0">);
</span>
177 </code><button>Copy
</button></pre>
178 <p>Returns a reference to the
<code>EventEmitter
</code>, so that calls can be chained.
</p>
179 </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-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 ts-flagRest">Rest
</code> <span class=
"tsd-signature-symbol">...
</span><span class=
"tsd-kind-parameter">args
</span>:
<span class=
"tsd-signature-type">any
</span><span class=
"tsd-signature-symbol">[]
</span></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>Since
</h4><p>v0.1
.26</p>
180 </div><aside class=
"tsd-sources"><p>Inherited from EventEmitter.removeListener
</p><ul><li>Defined in node_modules/.pnpm/@types+node@
20.12.11/node_modules/@types/node/events.d.ts:
695</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
181 added for a particular event. This is a useful default that helps finding
182 memory leaks. The
<code>emitter.setMaxListeners()
</code> method allows the limit to be
183 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>
184 <p>Returns a reference to the
<code>EventEmitter
</code>, so that calls can be chained.
</p>
185 </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>Since
</h4><p>v0.3
.5</p>
186 </div><aside class=
"tsd-sources"><p>Inherited from EventEmitter.setMaxListeners
</p><ul><li>Defined in node_modules/.pnpm/@types+node@
20.12.11/node_modules/@types/node/events.d.ts:
721</li></ul></aside></li></ul></section></section></div><div class=
"col-sidebar"><div class=
"page-menu"><div class=
"tsd-navigation settings"><details class=
"tsd-index-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"><h4 class=
"uppercase">Member Visibility
</h4><form><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-private" name=
"private"/><svg width=
"32" height=
"32" viewBox=
"0 0 32 32" aria-hidden=
"true"><rect class=
"tsd-checkbox-background" width=
"30" height=
"30" x=
"1" y=
"1" rx=
"6" fill=
"none"></rect><path class=
"tsd-checkbox-checkmark" d=
"M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke=
"none" stroke-width=
"3.5" stroke-linejoin=
"round" fill=
"none"></path></svg><span>Private
</span></label></li><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></form></div><div class=
"tsd-theme-toggle"><h4 class=
"uppercase">Theme
</h4><select id=
"tsd-theme"><option value=
"os">OS
</option><option value=
"light">Light
</option><option value=
"dark">Dark
</option></select></div></div></details></div><details open
class=
"tsd-index-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"><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=
"#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><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><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
.5</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>