X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Finterfaces%2FIWorkerNode.html;h=34ac49bb6ad37696398b8a9aa5de94a88f79270d;hb=5e133e82f086deb4b1ad5803b5df64ff924c69f1;hp=b410b9c47ca1828214838bbf482b4f6453659f07;hpb=1f9e78bf296d318acc29016077d9aa29f305a04f;p=poolifier.git diff --git a/docs/interfaces/IWorkerNode.html b/docs/interfaces/IWorkerNode.html index b410b9c4..34ac49bb 100644 --- a/docs/interfaces/IWorkerNode.html +++ b/docs/interfaces/IWorkerNode.html @@ -1,7 +1,7 @@ -
Internal
Worker node interface.
+- Preparing search index...
- The search index is not available
poolifier - v3.1.12Interface IWorkerNode<Worker, Data>
Internal
Worker node interface.
    clearTasksQueue: (() => void);
    deleteTaskFunctionWorkerUsage: ((name) => boolean);
    dequeueTask: (() => undefined | Task<Data>);
    enqueueTask: ((task) => number);
    getTaskFunctionWorkerUsage: ((name) => undefined | WorkerUsage);
    hasBackPressure: (() => boolean);
    info: WorkerInfo;
    messageChannel?: MessageChannel;
    popTask: (() => undefined | Task<Data>);
    registerOnceWorkerEventHandler: ((event, handler) => void);
    registerWorkerEventHandler: ((event, handler) => void);
    resetUsage: (() => void);
    strategyData?: StrategyData;
    tasksQueueBackPressureSize: number;
    tasksQueueSize: (() => number);
    terminate: (() => Promise<void>);
    unshiftTask: ((task) => number);
    usage: WorkerUsage;
    worker: Worker;
    [captureRejectionSymbol]?(error, event, ...args): void;
    addListener(eventName, listener): IWorkerNode<Worker, Data>;
    emit(eventName, ...args): boolean;
    eventNames(): (string | symbol)[];
    getMaxListeners(): number;
    listenerCount(eventName, listener?): number;
    listeners(eventName): Function[];
    off(eventName, listener): IWorkerNode<Worker, Data>;
    on(eventName, listener): IWorkerNode<Worker, Data>;
    once(eventName, listener): IWorkerNode<Worker, Data>;
    prependListener(eventName, listener): IWorkerNode<Worker, Data>;
    prependOnceListener(eventName, listener): IWorkerNode<Worker, Data>;
    rawListeners(eventName): Function[];
    removeAllListeners(event?): IWorkerNode<Worker, Data>;
    removeListener(eventName, listener): IWorkerNode<Worker, Data>;
    setMaxListeners(n): IWorkerNode<Worker, Data>;
}
Type Parameters
Worker extends IWorker
Type of worker.
Data = unknown
Type of data sent to the worker. This can only be structured-cloneable data.
-Hierarchy
Index
Properties
Hierarchy
Index
Properties
Properties
Readonly
clearType declaration
Clears tasks queue.
-Returns void
Readonly
deleteType declaration
Deletes task function worker usage statistics.
+Returns void
Readonly
deleteType declaration
Deletes task function worker usage statistics.
Parameters
name: string
The task function name.
Returns boolean
-true
if the task function worker usage statistics were deleted,false
otherwise.Readonly
dequeueType declaration
Dequeue task.
+Readonly
dequeueType declaration
Dequeue task.
Returns undefined | Task<Data>
The dequeued task.
-Readonly
enqueueType declaration
Enqueue task.
+Readonly
enqueueType declaration
Enqueue task.
Parameters
task: Task<Data>
The task to queue.
Returns number
The tasks queue size.
-Readonly
getType declaration
Gets task function worker usage statistics.
+Readonly
getType declaration
Gets task function worker usage statistics.
Parameters
name: string
The task function name.
Returns undefined | WorkerUsage
The task function worker usage statistics if the task function worker usage statistics are initialized,
-undefined
otherwise.Readonly
hasType declaration
Whether the worker node has back pressure (i.e. its tasks queue is full).
+Readonly
hasType declaration
Whether the worker node has back pressure (i.e. its tasks queue is full).
Returns boolean
-true
if the worker node has back pressure,false
otherwise.Readonly
infoWorker info.
-Optional
Readonly
messageMessage channel (worker thread only).
-Readonly
popType declaration
Pops a task from the tasks queue.
+Readonly
infoWorker info.
+Optional
Readonly
messageMessage channel (worker thread only).
+Readonly
popType declaration
Pops a task from the tasks queue.
Returns undefined | Task<Data>
The popped task.
-Readonly
registerType declaration
Registers once a worker event handler.
+Readonly
registerType declaration
Registers once a worker event handler.
Parameters
event: string
The event.
handler: OnlineHandler<Worker> | MessageHandler<Worker> | ErrorHandler<Worker> | ExitHandler<Worker>
The event handler.
-Returns void
Readonly
registerType declaration
Registers a worker event handler.
+Returns void
Readonly
registerType declaration
Registers a worker event handler.
Parameters
event: string
The event.
handler: OnlineHandler<Worker> | MessageHandler<Worker> | ErrorHandler<Worker> | ExitHandler<Worker>
The event handler.
-Returns void
Readonly
resetType declaration
Resets usage statistics.
-Returns void
Optional
strategyWorker choice strategy data. +
Returns void
Readonly
resetType declaration
Resets usage statistics.
+Returns void
Optional
strategyWorker choice strategy data. This is used to store data that are specific to the worker choice strategy.
-tasks Queue Back Pressure Size
Tasks queue back pressure size. +
tasks Queue Back Pressure Size
Tasks queue back pressure size. This is the number of tasks that can be enqueued before the worker node has back pressure.
-Readonly
tasksType declaration
Tasks queue size.
+Readonly
tasksType declaration
Tasks queue size.
Returns number
The tasks queue size.
-Readonly
terminateType declaration
Terminates the worker node.
-Returns Promise<void>
Readonly
unshiftType declaration
Prepends a task to the tasks queue.
+Readonly
terminateType declaration
Terminates the worker node.
+Returns Promise<void>
Readonly
unshiftType declaration
Prepends a task to the tasks queue.
Parameters
task: Task<Data>
The task to prepend.
Returns number
The tasks queue size.
-Readonly
usageWorker usage statistics.
-Readonly
workerWorker.
-Methods
Optional
[captureParameters
error: Error
event: string
Rest
...args: any[]Returns void
add Listener
Alias for
+emitter.on(eventName, listener)
.Readonly
usageWorker usage statistics.
+Readonly
workerWorker.
+Methods
Optional
[captureParameters
error: Error
event: string
Rest
...args: any[]Returns void
add Listener
Alias for
emitter.on(eventName, listener)
.Parameters
eventName: string | symbol
listener: ((...args) => void)
Parameters
Rest
...args: any[]Returns void
Returns IWorkerNode<Worker, Data>
Since
v0.1.26
emit
Synchronously calls each of the listeners registered for the event named
@@ -186,4 +186,4 @@ memory leaks. TheeventName
, in the order they were registered, passing the supplied arguments to each.emitter.setMaxListeners()
method allows the limit modified for this specificEventEmitter
instance. The value can be set toInfinity
(or0
) to indicate an unlimited number of listeners.Returns a reference to the
EventEmitter
, so that calls can be chained.Parameters
n: number
Returns IWorkerNode<Worker, Data>
Since
v0.3.5
-Settings
Member Visibility
Theme
On This Page
Generated using TypeDoc
Settings
Member Visibility
Theme
On This Page
Generated using TypeDoc