X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Finterfaces%2FIWorkerNode.html;h=9851dc4f308da243282f5906abdeb1beda547400;hb=refs%2Ftags%2Fv3.1.7;hp=b96935224c15b701f8262ecaa74e2ae0b541d014;hpb=f9fc489a415da7131735b04b0af50b1143dbdf70;p=poolifier.git diff --git a/docs/interfaces/IWorkerNode.html b/docs/interfaces/IWorkerNode.html index b9693522..9851dc4f 100644 --- a/docs/interfaces/IWorkerNode.html +++ b/docs/interfaces/IWorkerNode.html @@ -1,8 +1,7 @@ -IWorkerNode | poolifier - v3.0.5

Interface IWorkerNode<Worker, Data>Internal

Worker node interface.

-

Type Parameters

Hierarchy

  • EventEmitter
    • IWorkerNode

Properties

clearTasksQueue: (() => void)

Type declaration

    • (): void
    • Clears tasks queue.

      -

      Returns void

closeChannel: (() => void)

Type declaration

    • (): void
    • Closes communication channel.

      -

      Returns void

deleteTaskFunctionWorkerUsage: ((name) => boolean)

Type declaration

    • (name): boolean
    • Deletes task function worker usage statistics.

      +

      Returns void

deleteTaskFunctionWorkerUsage: ((name) => boolean)

Type declaration

    • (name): boolean
    • 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.

      -
dequeueTask: (() => undefined | Task<Data>)

Type declaration

    • (): undefined | Task<Data>
    • Dequeue task.

      +
dequeueTask: (() => undefined | Task<Data>)

Type declaration

    • (): undefined | Task<Data>
    • Dequeue task.

      Returns undefined | Task<Data>

      The dequeued task.

      -
enqueueTask: ((task) => number)

Type declaration

    • (task): number
    • Enqueue task.

      +
enqueueTask: ((task) => number)

Type declaration

    • (task): number
    • Enqueue task.

      Parameters

      • task: Task<Data>

        The task to queue.

      Returns number

      The tasks queue size.

      -
getTaskFunctionWorkerUsage: ((name) => undefined | WorkerUsage)

Type declaration

    • (name): undefined | WorkerUsage
    • Gets task function worker usage statistics.

      +
getTaskFunctionWorkerUsage: ((name) => undefined | WorkerUsage)

Type declaration

    • (name): undefined | WorkerUsage
    • 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.

      -
hasBackPressure: (() => boolean)

Type declaration

    • (): boolean
    • Whether the worker node has back pressure (i.e. its tasks queue is full).

      +
hasBackPressure: (() => boolean)

Type declaration

    • (): boolean
    • 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.

      -

Worker info.

-
messageChannel?: MessageChannel

Message channel (worker_threads only).

-
popTask: (() => undefined | Task<Data>)

Type declaration

    • (): undefined | Task<Data>
    • Pops a task from the tasks queue.

      +

Worker info.

+
messageChannel?: MessageChannel

Message channel (worker thread only).

+
popTask: (() => undefined | Task<Data>)

Type declaration

    • (): undefined | Task<Data>
    • Pops a task from the tasks queue.

      Returns undefined | Task<Data>

      The popped task.

      -
resetUsage: (() => void)

Type declaration

    • (): void
    • Resets usage statistics.

      -

      Returns void

strategyData?: StrategyData

Worker choice strategy data. +

registerOnceWorkerEventHandler: ((event, handler) => void)

Type declaration

registerWorkerEventHandler: ((event, handler) => void)

Type declaration

resetUsage: (() => void)

Type declaration

    • (): void
    • Resets usage statistics.

      +

      Returns void

strategyData?: StrategyData

Worker choice strategy data. This is used to store data that are specific to the worker choice strategy.

-
tasksQueueBackPressureSize: number

Tasks queue back pressure size. +

tasksQueueBackPressureSize: number

Tasks queue back pressure size. This is the number of tasks that can be enqueued before the worker node has back pressure.

-
tasksQueueSize: (() => number)

Type declaration

tasksQueueSize: (() => number)

Type declaration

    • (): number
    • Tasks queue size.

      Returns number

      The tasks queue size.

      -
unshiftTask: ((task) => number)

Type declaration

    • (task): number
    • Prepends a task to the tasks queue.

      +
terminate: (() => Promise<void>)

Type declaration

    • (): Promise<void>
    • Terminates the worker node.

      +

      Returns Promise<void>

unshiftTask: ((task) => number)

Type declaration

    • (task): number
    • Prepends a task to the tasks queue.

      Parameters

      • task: Task<Data>

        The task to prepend.

      Returns number

      The tasks queue size.

      -

Worker usage statistics.

-
worker: Worker

Worker.

-

Methods

  • Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

    -

    The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.

    -

    When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.

    -

    When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.

    -

    When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.

    -

    If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.

    -

    The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.

    -

    MDN Reference

    -

    Parameters

    • type: string
    • callback: null | EventListenerOrEventListenerObject
    • Optional options: boolean | AddEventListenerOptions

    Returns void

  • Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

    -

    MDN Reference

    -

    Parameters

    • event: Event

    Returns boolean

  • Removes the event listener in target's event listener list with the same type, callback, and options.

    -

    MDN Reference

    -

    Parameters

    • type: string
    • callback: null | EventListenerOrEventListenerObject
    • Optional options: boolean | EventListenerOptions

    Returns void

Generated using TypeDoc

\ No newline at end of file +
usage: WorkerUsage

Worker usage statistics.

+
worker: Worker

Worker.

+

Methods

Generated using TypeDoc

\ No newline at end of file