From 627fc572465ba2113cbf3df6bd055c3242ecd0fe Mon Sep 17 00:00:00 2001 From: Documentation Bot Date: Thu, 20 Jun 2024 13:01:08 +0000 Subject: [PATCH] docs: generate documentation --- docs/classes/AbstractPool.html | 124 +++++++++--------- docs/classes/AbstractWorker.html | 62 ++++----- docs/classes/CircularBuffer.html | 18 +-- docs/classes/ClusterWorker.html | 50 +++---- docs/classes/DynamicClusterPool.html | 80 +++++------ docs/classes/DynamicThreadPool.html | 80 +++++------ docs/classes/FixedClusterPool.html | 80 +++++------ docs/classes/FixedPriorityQueue.html | 28 ++-- docs/classes/FixedThreadPool.html | 80 +++++------ docs/classes/PriorityQueue.html | 22 ++-- docs/classes/ThreadWorker.html | 52 ++++---- .../WorkerChoiceStrategiesContext.html | 42 +++--- docs/functions/availableParallelism.html | 4 +- docs/hierarchy.html | 2 +- docs/index.html | 4 +- ...tLoopUtilizationMeasurementStatistics.html | 6 +- docs/interfaces/FixedPriorityQueueNode.html | 6 +- docs/interfaces/IPool.html | 36 ++--- docs/interfaces/IWorker.html | 46 +++---- docs/interfaces/IWorkerChoiceStrategy.html | 18 +-- docs/interfaces/IWorkerNode.html | 70 +++++----- docs/interfaces/MeasurementOptions.html | 6 +- docs/interfaces/MeasurementStatistics.html | 16 +-- .../MeasurementStatisticsRequirements.html | 10 +- docs/interfaces/MessageValue.html | 44 +++---- docs/interfaces/PoolInfo.html | 16 +-- docs/interfaces/PoolOptions.html | 32 ++--- docs/interfaces/PriorityQueueNode.html | 24 ++-- docs/interfaces/PromiseResponseWrapper.html | 12 +- docs/interfaces/StrategyData.html | 6 +- docs/interfaces/StrategyPolicy.html | 8 +- docs/interfaces/Task.html | 18 +-- docs/interfaces/TaskFunctionObject.html | 10 +- .../TaskFunctionOperationResult.html | 6 +- docs/interfaces/TaskFunctionProperties.html | 10 +- docs/interfaces/TaskPerformance.html | 12 +- docs/interfaces/TaskStatistics.html | 18 +-- .../TaskStatisticsRequirements.html | 10 +- docs/interfaces/TasksQueueOptions.html | 14 +- .../WorkerChoiceStrategyOptions.html | 14 +- docs/interfaces/WorkerError.html | 10 +- docs/interfaces/WorkerInfo.html | 18 +-- docs/interfaces/WorkerNodeEventDetail.html | 6 +- docs/interfaces/WorkerNodeOptions.html | 6 +- docs/interfaces/WorkerOptions.html | 10 +- docs/interfaces/WorkerStatistics.html | 8 +- docs/interfaces/WorkerUsage.html | 12 +- docs/types/ClusterPoolOptions.html | 4 +- docs/types/ErrorHandler.html | 4 +- docs/types/EventHandler.html | 4 +- docs/types/ExitHandler.html | 4 +- docs/types/KillBehavior.html | 4 +- docs/types/KillHandler.html | 4 +- docs/types/Measurement.html | 4 +- docs/types/MessageHandler.html | 4 +- docs/types/OnlineHandler.html | 4 +- docs/types/PoolEvent.html | 4 +- docs/types/PoolType.html | 4 +- docs/types/TaskAsyncFunction.html | 4 +- docs/types/TaskFunction.html | 4 +- docs/types/TaskFunctions.html | 4 +- docs/types/TaskSyncFunction.html | 4 +- docs/types/ThreadPoolOptions.html | 4 +- docs/types/WorkerChoiceStrategy.html | 4 +- docs/types/WorkerType.html | 4 +- docs/types/Writable.html | 2 +- docs/variables/KillBehaviors.html | 4 +- docs/variables/Measurements.html | 4 +- docs/variables/PoolEvents.html | 4 +- docs/variables/PoolTypes.html | 4 +- docs/variables/WorkerChoiceStrategies.html | 4 +- docs/variables/WorkerTypes.html | 4 +- 72 files changed, 688 insertions(+), 676 deletions(-) diff --git a/docs/classes/AbstractPool.html b/docs/classes/AbstractPool.html index 2f70e490..23d24db2 100644 --- a/docs/classes/AbstractPool.html +++ b/docs/classes/AbstractPool.html @@ -1,8 +1,8 @@ -AbstractPool | poolifier - v4.0.14

Class AbstractPool<Worker, Data, Response>Abstract

Base class that implements some shared logic for all poolifier pools.

+AbstractPool | poolifier - v4.0.15

Class AbstractPool<Worker, Data, Response>Abstract

Base class that implements some shared logic for all poolifier pools.

Type Parameters

  • Worker extends IWorker

    Type of worker which manages this pool.

  • Data = unknown

    Type of data sent to the worker. This can only be structured-cloneable data.

  • Response = unknown

    Type of execution response. This can only be structured-cloneable data.

    -

Hierarchy (view full)

Implements

Constructors

Hierarchy (view full)

Implements

Constructors

Properties

destroying emitter? filePath @@ -117,8 +117,8 @@
  • filePath: string

    Path to the worker file.

  • opts: PoolOptions<Worker>

    Options for the pool.

  • Optional maximumNumberOfWorkers: number

    Maximum number of workers that this pool manages.

    -
  • Returns AbstractPool<Worker, Data, Response>

    Properties

    destroying: boolean

    Whether the pool is destroying or not.

    -
    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. +

    Returns AbstractPool<Worker, Data, Response>

    Properties

    destroying: boolean

    Whether the pool is destroying or not.

    +
    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. The async tracking tooling identifier is poolifier:<PoolType>-<WorkerType>-pool.

    Events that can currently be listened to:

      @@ -131,128 +131,130 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'taskError': Emitted when an error occurs while executing a task.
    • 'backPressure': Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size >= maximum queue size).
    -
    filePath: string

    Path to the worker file.

    -
    maximumNumberOfWorkers?: number

    Maximum number of workers that this pool manages.

    -
    minimumNumberOfWorkers: number

    Minimum number of workers that this pool manages.

    -

    Options for the pool.

    -
    promiseResponseMap: Map<`${string}-${string}-${string}-${string}-${string}`, PromiseResponseWrapper<Response>> = ...

    The task execution response promise map:

    +
    filePath: string

    Path to the worker file.

    +
    maximumNumberOfWorkers?: number

    Maximum number of workers that this pool manages.

    +
    minimumNumberOfWorkers: number

    Minimum number of workers that this pool manages.

    +

    Options for the pool.

    +
    promiseResponseMap: Map<`${string}-${string}-${string}-${string}-${string}`, PromiseResponseWrapper<Response>> = ...

    The task execution response promise map:

    • key: The message id of each submitted task.
    • value: An object that contains task's worker node key, execution response promise resolve and reject callbacks, async resource.

    When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id.

    -
    readyEventEmitted: boolean

    Whether the pool ready event has been emitted or not.

    -
    startTimestamp?: number

    The start timestamp of the pool.

    -
    started: boolean

    Whether the pool is started or not.

    -
    starting: boolean

    Whether the pool is starting or not.

    -
    startingMinimumNumberOfWorkers: boolean

    Whether the minimum number of workers is starting or not.

    -
    taskFunctions: Map<string, TaskFunctionObject<Data, Response>>

    The task functions added at runtime map:

    +
    readyEventEmitted: boolean

    Whether the pool ready event has been emitted or not.

    +
    startTimestamp?: number

    The start timestamp of the pool.

    +
    started: boolean

    Whether the pool is started or not.

    +
    starting: boolean

    Whether the pool is starting or not.

    +
    startingMinimumNumberOfWorkers: boolean

    Whether the minimum number of workers is starting or not.

    +
    taskFunctions: Map<string, TaskFunctionObject<Data, Response>>

    The task functions added at runtime map:

    • key: The task function name.
    • value: The task function object.
    -
    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

    -
    workerNodes: IWorkerNode<Worker, Data>[] = []

    Pool worker nodes.

    -

    Accessors

    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

    +
    workerNodes: IWorkerNode<Worker, Data>[] = []

    Pool worker nodes.

    +

    Accessors

    • get type(): "fixed" | "dynamic"
    • The pool type.

      If it is 'dynamic', it provides the max property.

      -

      Returns "fixed" | "dynamic"

    Methods

    Methods

    • Hook executed after the worker task execution. Can be overridden.

      Parameters

      • workerNodeKey: number

        The worker node key.

      • message: MessageValue<Response, unknown>

        The received message.

        -

      Returns void

    • Method hooked up after a worker node has been newly created. +

    Returns void

    • Method hooked up after a worker node has been newly created. Can be overridden.

      Parameters

      • workerNodeKey: number

        The newly created worker node key.

        -

      Returns void

    • Hook executed before the worker task execution. +

    Returns void

    • Hook executed before the worker task execution. Can be overridden.

      Parameters

      • workerNodeKey: number

        The worker node key.

      • task: Task<Data>

        The task to execute.

        -

      Returns void

    • Checks if the worker id sent in the received message from a worker is valid.

      +

    Returns void

    • Parameters

      • minimumNumberOfWorkers: undefined | number

      Returns void

    • Parameters

      • minimumNumberOfWorkers: undefined | number

      Returns void

    • Chooses a worker node for the next task.

      Parameters

      • Optional name: string

        The task function name.

      Returns number

      The chosen worker node key.

      -
    • Creates a new, completely set up dynamic worker node.

      Returns number

      New, completely set up dynamic worker node key.

      -
    • Creates a new, completely set up worker node.

      Returns number

      New, completely set up worker node key.

      -
    • Deregisters a listener callback on the worker given its worker node key.

      Type Parameters

      • Message

      Parameters

      • workerNodeKey: number

        The worker node key.

      • listener: ((message) => void)

        The message listener callback.

        -

      Returns void

    • Terminates the worker node given its worker node key.

      +

    Returns void

    • Terminates the worker node given its worker node key.

      Parameters

      • workerNodeKey: number

        The worker node key.

        -

      Returns Promise<void>

    • Executes the given task on the worker given its worker node key.

      +

    Returns Promise<void>

    • Executes the given task on the worker given its worker node key.

      Parameters

      • workerNodeKey: number

        The worker node key.

      • task: Task<Data>

        The task to execute.

        -

      Returns void

    • Gets task function worker choice strategy, if any.

      +

    Returns void

    • Gets task function worker choice strategy, if any.

      Parameters

      • Optional name: string

        The task function name.

      Returns undefined | "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

      The task function worker choice strategy if the task function worker choice strategy is defined, undefined otherwise.

      -
    • Gets the worker choice strategies registered in this pool.

      +
    • Gets the worker choice strategies registered in this pool.

      Returns Set<"ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN">

      The worker choice strategies.

      -
    • Gets the worker information given its worker node key.

      Parameters

      • workerNodeKey: number

        The worker node key.

      Returns undefined | WorkerInfo

      The worker information.

      -
    • Gets the worker node key given its worker id.

      Parameters

      • workerId: undefined | number

        The worker id.

      Returns number

      The worker node key if the worker id is found in the pool worker nodes, -1 otherwise.

      -
    • Gets worker node task function priority, if any.

      +
    • Gets worker node task function priority, if any.

      Parameters

      • workerNodeKey: number

        The worker node key.

      • Optional name: string

        The task function name.

      Returns undefined | number

      The worker node task function priority if the worker node task function priority is defined, undefined otherwise.

      -
    • Gets worker node task function worker choice strategy, if any.

      +
    • Gets worker node task function worker choice strategy, if any.

      Parameters

      • workerNodeKey: number

        The worker node key.

      • Optional name: string

        The task function name.

      Returns undefined | "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

      The worker node task function worker choice strategy if the worker node task function worker choice strategy is defined, undefined otherwise.

      -
    • Initializes the worker node usage with sensible default values gathered during runtime.

      +
    • Whether worker nodes are executing concurrently their tasks quota or not.

      +

    Returns void

    • Whether worker nodes are executing concurrently their tasks quota or not.

      Returns boolean

      Worker nodes busyness boolean status.

      -
    • Returns whether the worker is the main worker or not.

      Returns boolean

      true if the worker is the main worker, false otherwise.

      -
    • Registers once a listener callback on the worker given its worker node key.

      +
    • Registers once a listener callback on the worker given its worker node key.

      Type Parameters

      • Message

      Parameters

      • workerNodeKey: number

        The worker node key.

      • listener: ((message) => void)

        The message listener callback.

        -

      Returns void

    • Registers a listener callback on the worker given its worker node key.

      +

    Returns void

    • Registers a listener callback on the worker given its worker node key.

      Type Parameters

      • Message

      Parameters

      • workerNodeKey: number

        The worker node key.

      • listener: ((message) => void)

        The message listener callback.

        -

      Returns void

    • Removes the worker node from the pool worker nodes.

      +

    Returns void

    • Parameters

      • workerNodeKey: number
      • taskName: string

      Returns void

    • Sends the startup message to worker given its worker node key.

      +

    Returns void

    • Parameters

      • workerNodeKey: number
      • taskName: string

      Returns void

    • Sends the startup message to worker given its worker node key.

      Parameters

      • workerNodeKey: number

        The worker node key.

        -

      Returns void

    • Sends the statistics message to worker given its worker node key.

      +

    Returns void

    • Sends the statistics message to worker given its worker node key.

      Parameters

      • workerNodeKey: number

        The worker node key.

        -

      Returns void

    • Sends a message to worker given its worker node key.

      +

    Returns void

    • Sends a message to worker given its worker node key.

      Parameters

      • workerNodeKey: number

        The worker node key.

      • message: MessageValue<Data, unknown>

        The message.

      • Optional transferList: readonly TransferListItem[]

        The optional array of transferable objects.

        -

      Returns void

    • Setup hook to execute code before worker nodes are created in the abstract constructor. +

    Returns void

    • Setup hook to execute code before worker nodes are created in the abstract constructor. Can be overridden.

      -

      Returns void

    • Conditions for dynamic worker creation.

      Returns boolean

      Whether to create a dynamic worker or not.

      -
    • Whether the worker node shall update its task function worker usage or not.

      +
    • Whether the worker node shall update its task function worker usage or not.

      Parameters

      • workerNodeKey: number

        The worker node key.

      Returns boolean

      true if the worker node shall update its task function worker usage, false otherwise.

      -
    • Starts the minimum number of workers.

      Parameters

      • initWorkerNodeUsage: boolean = false

        Whether to initialize the worker node usage or not.

      Returns void

      Default Value

      false
       
      -
    • Parameters

      • workerNodeKey: number
      • taskName: string
      • Optional previousTaskName: string

      Returns void

    • Parameters

      • workerNodeKey: number
      • taskName: string

      Returns void

    • Parameters

      • workerNodeKey: number
      • taskName: string
      • Optional previousTaskName: string

      Returns void

    • Parameters

      • workerNodeKey: number
      • taskName: string

      Returns void

    \ No newline at end of file +

    Returns void

    \ No newline at end of file diff --git a/docs/classes/AbstractWorker.html b/docs/classes/AbstractWorker.html index 7db62ced..49e21de7 100644 --- a/docs/classes/AbstractWorker.html +++ b/docs/classes/AbstractWorker.html @@ -1,8 +1,8 @@ -AbstractWorker | poolifier - v4.0.14

    Class AbstractWorker<MainWorker, Data, Response>Abstract

    Base class that implements some shared logic for all poolifier workers.

    +AbstractWorker | poolifier - v4.0.15

    Class AbstractWorker<MainWorker, Data, Response>Abstract

    Base class that implements some shared logic for all poolifier workers.

    Type Parameters

    • MainWorker extends Worker | MessagePort

      Type of main worker.

    • Data = unknown

      Type of data this worker receives from pool's execution. This can only be structured-cloneable data.

    • Response = unknown

      Type of response the worker sends back to the main worker. This can only be structured-cloneable data.

      -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    activeInterval? id isMain @@ -41,59 +41,59 @@
  • mainWorker: undefined | null | MainWorker

    Reference to main worker.

  • taskFunctions: TaskFunction<Data, Response> | TaskFunctions<Data, Response>

    Task function(s) processed by the worker when the pool's execution function is invoked. The first function is the default function.

  • opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

    Options for the worker.

    -
  • Returns AbstractWorker<MainWorker, Data, Response>

    Properties

    activeInterval?: Timeout

    Handler id of the activeInterval worker activity check.

    -
    id: number

    Worker id.

    -
    isMain: undefined | boolean

    Whether this is the main worker or not.

    -
    lastTaskTimestamp: number

    Timestamp of the last task processed by this worker.

    -
    mainWorker: undefined | null | MainWorker

    Reference to main worker.

    -
    opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

    Options for the worker.

    -
    statistics?: WorkerStatistics

    Performance statistics computation requirements.

    -
    taskFunctions: Map<string, TaskFunctionObject<Data, Response>>

    Task function object(s) processed by the worker when the pool's execution function is invoked.

    -

    Methods

    Returns AbstractWorker<MainWorker, Data, Response>

    Properties

    activeInterval?: Timeout

    Handler id of the activeInterval worker activity check.

    +
    id: number

    Worker id.

    +
    isMain: undefined | boolean

    Whether this is the main worker or not.

    +
    lastTaskTimestamp: number

    Timestamp of the last task processed by this worker.

    +
    mainWorker: undefined | null | MainWorker

    Reference to main worker.

    +
    opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

    Options for the worker.

    +
    statistics?: WorkerStatistics

    Performance statistics computation requirements.

    +
    taskFunctions: Map<string, TaskFunctionObject<Data, Response>>

    Task function object(s) processed by the worker when the pool's execution function is invoked.

    +

    Methods

    • Returns the main worker.

      +

    Returns void

    • Handles an error and convert it to a string so it can be sent back to the main worker.

      Parameters

      • error: string | Error

        The error raised by the worker.

      Returns string

      The error message.

      -
    • Handles the ready message sent by the main worker.

      +

    Returns void

    Returns void

    Returns void

    • Runs the given task function asynchronously.

      +

    Returns void

    • Runs the given task function synchronously.

      +

    Returns void

    • Sends a message to main worker.

      +

    Returns void

    Returns void

    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/CircularBuffer.html b/docs/classes/CircularBuffer.html index 485899f1..2ebcde63 100644 --- a/docs/classes/CircularBuffer.html +++ b/docs/classes/CircularBuffer.html @@ -1,5 +1,5 @@ -CircularBuffer | poolifier - v4.0.14

    Class CircularBufferInternal

    Circular buffer designed for positive numbers.

    -

    Constructors

    constructor +CircularBuffer | poolifier - v4.0.15

    Class CircularBufferInternal

    Circular buffer designed for positive numbers.

    +

    Constructors

    Properties

    items maxArrayIdx readIdx @@ -15,16 +15,16 @@

    Returns CircularBuffer

    CircularBuffer.

    Default Value

    defaultBufferSize
     
    -

    Properties

    items: Float32Array
    maxArrayIdx: number
    readIdx: number
    size: number
    writeIdx: number

    Methods

    Properties

    items: Float32Array
    maxArrayIdx: number
    readIdx: number
    size: number
    writeIdx: number

    Methods

    • Checks the buffer size.

      Parameters

      • size: number

        Buffer size.

        -

      Returns void

    • Checks whether the buffer is empty.

      +

    Returns void

    • Checks whether the buffer is empty.

      Returns boolean

      Whether the buffer is empty.

      -
    • Checks whether the buffer is full.

      Returns boolean

      Whether the buffer is full.

      -
    • Gets number from buffer.

      Returns undefined | number

      Number from buffer.

      -
    • Puts number into buffer.

      Parameters

      • number: number

        Number to put into buffer.

        -

      Returns void

    • Returns buffer as numbers' array.

      +

    Returns void

    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/ClusterWorker.html b/docs/classes/ClusterWorker.html index 58edc644..aaea291e 100644 --- a/docs/classes/ClusterWorker.html +++ b/docs/classes/ClusterWorker.html @@ -1,4 +1,4 @@ -ClusterWorker | poolifier - v4.0.14

    Class ClusterWorker<Data, Response>

    A cluster worker used by a poolifier ClusterPool.

    +ClusterWorker | poolifier - v4.0.15

    Class ClusterWorker<Data, Response>

    A cluster worker used by a poolifier ClusterPool.

    When this worker is inactive for more than the given maxInactiveTime, it will send a termination request to its main worker.

    If you use a DynamicClusterPool the extra workers that were created will be terminated, @@ -7,7 +7,7 @@ but the minimum number of workers will be guaranteed.

    Since

    2.0.0

    Type Parameters

    • Data = unknown

      Type of data this worker receives from pool's execution. This can only be structured-cloneable data.

    • Response = unknown

      Type of response the worker sends back to the main worker. This can only be structured-cloneable data.

      -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    activeInterval? isMain lastTaskTimestamp @@ -34,50 +34,50 @@ but the minimum number of workers will be guaranteed.

    Constructors

    Properties

    activeInterval?: Timeout

    Handler id of the activeInterval worker activity check.

    -
    isMain: undefined | boolean

    Whether this is the main worker or not.

    -
    lastTaskTimestamp: number

    Timestamp of the last task processed by this worker.

    -
    opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

    Options for the worker.

    -
    statistics?: WorkerStatistics

    Performance statistics computation requirements.

    -
    taskFunctions: Map<string, TaskFunctionObject<Data, Response>>

    Task function object(s) processed by the worker when the pool's execution function is invoked.

    -

    Accessors

    Methods

    Returns ClusterWorker<Data, Response>

    Properties

    activeInterval?: Timeout

    Handler id of the activeInterval worker activity check.

    +
    isMain: undefined | boolean

    Whether this is the main worker or not.

    +
    lastTaskTimestamp: number

    Timestamp of the last task processed by this worker.

    +
    opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

    Options for the worker.

    +
    statistics?: WorkerStatistics

    Performance statistics computation requirements.

    +
    taskFunctions: Map<string, TaskFunctionObject<Data, Response>>

    Task function object(s) processed by the worker when the pool's execution function is invoked.

    +

    Accessors

    Methods

    • Handles an error and convert it to a string so it can be sent back to the main worker.

      Parameters

      • error: string | Error

        The error raised by the worker.

      Returns string

      The error message.

      -
    • Handles the ready message sent by the main worker.

      +

    Returns void

    Returns void

    Returns void

    • Runs the given task function asynchronously.

      +

    Returns void

    • Runs the given task function synchronously.

      +

    Returns void

    • Sends a message to main worker.

      +

    Returns void

    Returns void

    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/DynamicClusterPool.html b/docs/classes/DynamicClusterPool.html index d984f9e1..7b1fb47a 100644 --- a/docs/classes/DynamicClusterPool.html +++ b/docs/classes/DynamicClusterPool.html @@ -1,11 +1,11 @@ -DynamicClusterPool | poolifier - v4.0.14

    Class DynamicClusterPool<Data, Response>

    A cluster pool with a dynamic number of workers, but a guaranteed minimum number of workers.

    +DynamicClusterPool | poolifier - v4.0.15

    Class DynamicClusterPool<Data, Response>

    A cluster pool with a dynamic number of workers, but a guaranteed minimum number of workers.

    This cluster pool creates new workers when the others are busy, up to the maximum number of workers. When the maximum number of workers is reached and workers are busy, an event is emitted. If you want to listen to this event, use the pool's emitter.

    Author

    Christopher Quadflieg

    Since

    2.0.0

    Type Parameters

    • Data = unknown

      Type of data sent to the worker. This can only be structured-cloneable data.

    • Response = unknown

      Type of execution response. This can only be structured-cloneable data.

      -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    emitter? filePath maximumNumberOfWorkers? @@ -60,7 +60,7 @@ When the maximum number of workers is reached and workers are busy, an event is
  • max: number

    Maximum number of workers that can be created by this pool.

  • filePath: string

    Path to an implementation of a ClusterWorker file, which can be relative or absolute.

  • opts: ClusterPoolOptions = {}

    Options for this dynamic cluster pool.

    -
  • Returns DynamicClusterPool<Data, Response>

    Properties

    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. +

    Returns DynamicClusterPool<Data, Response>

    Properties

    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. The async tracking tooling identifier is poolifier:<PoolType>-<WorkerType>-pool.

    Events that can currently be listened to:

      @@ -73,73 +73,75 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'taskError': Emitted when an error occurs while executing a task.
    • 'backPressure': Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size >= maximum queue size).
    -
    filePath: string

    Path to the worker file.

    -
    maximumNumberOfWorkers?: number

    Maximum number of workers that this pool manages.

    -
    minimumNumberOfWorkers: number

    Minimum number of workers that this pool manages.

    -
    opts: PoolOptions<Worker>

    Options for the pool.

    -
    promiseResponseMap: Map<`${string}-${string}-${string}-${string}-${string}`, PromiseResponseWrapper<Response>> = ...

    The task execution response promise map:

    +
    filePath: string

    Path to the worker file.

    +
    maximumNumberOfWorkers?: number

    Maximum number of workers that this pool manages.

    +
    minimumNumberOfWorkers: number

    Minimum number of workers that this pool manages.

    +
    opts: PoolOptions<Worker>

    Options for the pool.

    +
    promiseResponseMap: Map<`${string}-${string}-${string}-${string}-${string}`, PromiseResponseWrapper<Response>> = ...

    The task execution response promise map:

    • key: The message id of each submitted task.
    • value: An object that contains task's worker node key, execution response promise resolve and reject callbacks, async resource.

    When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id.

    -
    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

    -
    workerNodes: IWorkerNode<Worker, Data>[] = []

    Pool worker nodes.

    -

    Accessors

    • get busy(): boolean
    • Whether the pool is busy or not.

      -

      The pool busyness boolean status.

      -

      Returns boolean

    • get full(): boolean
    • Whether the pool is full or not.

      -

      The pool filling boolean status.

      -

      Returns boolean

    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

    +
    workerNodes: IWorkerNode<Worker, Data>[] = []

    Pool worker nodes.

    +

    Accessors

    • get busy(): boolean
    • Whether the pool is busy or not.

      +

      Returns boolean

      The pool busyness boolean status.

      +
    • get empty(): boolean
    • Whether the pool is empty or not.

      +

      Returns boolean

      The pool emptiness boolean status.

      +
    • get full(): boolean
    • Whether the pool is full or not.

      +

      Returns boolean

      The pool fullness boolean status.

      +
    • get ready(): boolean
    • Whether the pool is ready or not.

      +

      Returns boolean

      The pool readiness boolean status.

      +
    • get type(): "fixed" | "dynamic"
    • The pool type.

      If it is 'dynamic', it provides the max property.

      -

      Returns "fixed" | "dynamic"

    • get utilization(): number
    • The approximate pool utilization.

      +

      Returns "fixed" | "dynamic"

    • get utilization(): number
    • The approximate pool utilization.

      Returns number

      The pool utilization.

      -
    • get worker(): "thread" | "cluster"
    • The worker type.

      -

      Returns "thread" | "cluster"

    Methods

    • Hook executed after the worker task execution. +

    • get worker(): "thread" | "cluster"
    • The worker type.

      +

      Returns "thread" | "cluster"

    Methods

    • Method hooked up after a worker node has been newly created. +

    Returns void

    • Hook executed before the worker task execution. +

    Returns void

    • Creates a new, completely set up dynamic worker node.

      +

    Returns void

    • Terminates the worker node given its worker node key.

      +

    Returns void

    • Gets the worker information given its worker node key.

      +

    Returns Promise<void>

    • Registers a listener callback on the worker given its worker node key.

      +

    Returns void

    • Sends the startup message to worker given its worker node key.

      +

    Returns void

    • Sends a message to worker given its worker node key.

      +

    Returns void

    • Setup hook to execute code before worker nodes are created in the abstract constructor. +

    Returns void

    \ No newline at end of file +

    Returns void

    \ No newline at end of file diff --git a/docs/classes/DynamicThreadPool.html b/docs/classes/DynamicThreadPool.html index 6f76be23..f81194d0 100644 --- a/docs/classes/DynamicThreadPool.html +++ b/docs/classes/DynamicThreadPool.html @@ -1,11 +1,11 @@ -DynamicThreadPool | poolifier - v4.0.14

    Class DynamicThreadPool<Data, Response>

    A thread pool with a dynamic number of threads, but a guaranteed minimum number of threads.

    +DynamicThreadPool | poolifier - v4.0.15

    Class DynamicThreadPool<Data, Response>

    A thread pool with a dynamic number of threads, but a guaranteed minimum number of threads.

    This thread pool creates new threads when the others are busy, up to the maximum number of threads. When the maximum number of threads is reached and workers are busy, an event is emitted. If you want to listen to this event, use the pool's emitter.

    Author

    Alessandro Pio Ardizio

    Since

    0.0.1

    Type Parameters

    • Data = unknown

      Type of data sent to the worker. This can only be structured-cloneable data.

    • Response = unknown

      Type of execution response. This can only be structured-cloneable data.

      -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    emitter? filePath maximumNumberOfWorkers? @@ -60,7 +60,7 @@ When the maximum number of threads is reached and workers are busy, an event is
  • max: number

    Maximum number of threads that can be created by this pool.

  • filePath: string

    Path to an implementation of a ThreadWorker file, which can be relative or absolute.

  • opts: ThreadPoolOptions = {}

    Options for this dynamic thread pool.

    -
  • Returns DynamicThreadPool<Data, Response>

    Properties

    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. +

    Returns DynamicThreadPool<Data, Response>

    Properties

    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. The async tracking tooling identifier is poolifier:<PoolType>-<WorkerType>-pool.

    Events that can currently be listened to:

      @@ -73,74 +73,76 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'taskError': Emitted when an error occurs while executing a task.
    • 'backPressure': Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size >= maximum queue size).
    -
    filePath: string

    Path to the worker file.

    -
    maximumNumberOfWorkers?: number

    Maximum number of workers that this pool manages.

    -
    minimumNumberOfWorkers: number

    Minimum number of workers that this pool manages.

    -
    opts: PoolOptions<Worker>

    Options for the pool.

    -
    promiseResponseMap: Map<`${string}-${string}-${string}-${string}-${string}`, PromiseResponseWrapper<Response>> = ...

    The task execution response promise map:

    +
    filePath: string

    Path to the worker file.

    +
    maximumNumberOfWorkers?: number

    Maximum number of workers that this pool manages.

    +
    minimumNumberOfWorkers: number

    Minimum number of workers that this pool manages.

    +
    opts: PoolOptions<Worker>

    Options for the pool.

    +
    promiseResponseMap: Map<`${string}-${string}-${string}-${string}-${string}`, PromiseResponseWrapper<Response>> = ...

    The task execution response promise map:

    • key: The message id of each submitted task.
    • value: An object that contains task's worker node key, execution response promise resolve and reject callbacks, async resource.

    When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id.

    -
    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

    -
    workerNodes: IWorkerNode<Worker, Data>[] = []

    Pool worker nodes.

    -

    Accessors

    • get busy(): boolean
    • Whether the pool is busy or not.

      -

      The pool busyness boolean status.

      -

      Returns boolean

    • get full(): boolean
    • Whether the pool is full or not.

      -

      The pool filling boolean status.

      -

      Returns boolean

    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

    +
    workerNodes: IWorkerNode<Worker, Data>[] = []

    Pool worker nodes.

    +

    Accessors

    • get busy(): boolean
    • Whether the pool is busy or not.

      +

      Returns boolean

      The pool busyness boolean status.

      +
    • get empty(): boolean
    • Whether the pool is empty or not.

      +

      Returns boolean

      The pool emptiness boolean status.

      +
    • get full(): boolean
    • Whether the pool is full or not.

      +

      Returns boolean

      The pool fullness boolean status.

      +
    • get ready(): boolean
    • Whether the pool is ready or not.

      +

      Returns boolean

      The pool readiness boolean status.

      +
    • get type(): "fixed" | "dynamic"
    • The pool type.

      If it is 'dynamic', it provides the max property.

      -

      Returns "fixed" | "dynamic"

    • get utilization(): number
    • The approximate pool utilization.

      +

      Returns "fixed" | "dynamic"

    • get utilization(): number
    • The approximate pool utilization.

      Returns number

      The pool utilization.

      -
    • get worker(): "thread" | "cluster"
    • The worker type.

      -

      Returns "thread" | "cluster"

    Methods

    • Hook executed after the worker task execution. +

    • get worker(): "thread" | "cluster"
    • The worker type.

      +

      Returns "thread" | "cluster"

    Methods

    • Method hooked up after a worker node has been newly created. +

    Returns void

    • Hook executed before the worker task execution. +

    Returns void

    • Creates a new, completely set up dynamic worker node.

      +

    Returns void

    • Terminates the worker node given its worker node key.

      +

    Returns void

    • Gets the worker information given its worker node key.

      +

    Returns Promise<void>

    • Registers a listener callback on the worker given its worker node key.

      +

    Returns void

    • Sends the startup message to worker given its worker node key.

      +

    Returns void

    • Sends a message to worker given its worker node key.

      +

    Returns void

    • Sends a message to worker given its worker node key.

      Parameters

      • workerNodeKey: number

        The worker node key.

      • message: MessageValue<Data, unknown>

        The message.

      • Optional transferList: readonly TransferListItem[]

        The optional array of transferable objects.

        -

      Returns void

    • Setup hook to execute code before worker nodes are created in the abstract constructor. +

    Returns void

    \ No newline at end of file +

    Returns void

    \ No newline at end of file diff --git a/docs/classes/FixedClusterPool.html b/docs/classes/FixedClusterPool.html index 58d399a0..f0527fbc 100644 --- a/docs/classes/FixedClusterPool.html +++ b/docs/classes/FixedClusterPool.html @@ -1,9 +1,9 @@ -FixedClusterPool | poolifier - v4.0.14

    Class FixedClusterPool<Data, Response>

    A cluster pool with a fixed number of workers.

    +FixedClusterPool | poolifier - v4.0.15

    Class FixedClusterPool<Data, Response>

    A cluster pool with a fixed number of workers.

    Author

    Christopher Quadflieg

    Since

    2.0.0

    Type Parameters

    • Data = unknown

      Type of data sent to the worker. This can only be structured-cloneable data.

    • Response = unknown

      Type of execution response. This can only be structured-cloneable data.

      -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

  • filePath: string

    Path to an implementation of a ClusterWorker file, which can be relative or absolute.

  • opts: ClusterPoolOptions = {}

    Options for this fixed cluster pool.

  • Optional maximumNumberOfWorkers: number

    The maximum number of workers for this pool.

    -
  • Returns FixedClusterPool<Data, Response>

    Properties

    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. +

    Returns FixedClusterPool<Data, Response>

    Properties

    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. The async tracking tooling identifier is poolifier:<PoolType>-<WorkerType>-pool.

    Events that can currently be listened to:

      @@ -71,73 +71,75 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'taskError': Emitted when an error occurs while executing a task.
    • 'backPressure': Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size >= maximum queue size).
    -
    filePath: string

    Path to the worker file.

    -
    maximumNumberOfWorkers?: number

    Maximum number of workers that this pool manages.

    -
    minimumNumberOfWorkers: number

    Minimum number of workers that this pool manages.

    -
    opts: PoolOptions<Worker>

    Options for the pool.

    -
    promiseResponseMap: Map<`${string}-${string}-${string}-${string}-${string}`, PromiseResponseWrapper<Response>> = ...

    The task execution response promise map:

    +
    filePath: string

    Path to the worker file.

    +
    maximumNumberOfWorkers?: number

    Maximum number of workers that this pool manages.

    +
    minimumNumberOfWorkers: number

    Minimum number of workers that this pool manages.

    +
    opts: PoolOptions<Worker>

    Options for the pool.

    +
    promiseResponseMap: Map<`${string}-${string}-${string}-${string}-${string}`, PromiseResponseWrapper<Response>> = ...

    The task execution response promise map:

    • key: The message id of each submitted task.
    • value: An object that contains task's worker node key, execution response promise resolve and reject callbacks, async resource.

    When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id.

    -
    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

    -
    workerNodes: IWorkerNode<Worker, Data>[] = []

    Pool worker nodes.

    -

    Accessors

    • get busy(): boolean
    • Whether the pool is busy or not.

      -

      The pool busyness boolean status.

      -

      Returns boolean

    • get full(): boolean
    • Whether the pool is full or not.

      -

      The pool filling boolean status.

      -

      Returns boolean

    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

    +
    workerNodes: IWorkerNode<Worker, Data>[] = []

    Pool worker nodes.

    +

    Accessors

    • get busy(): boolean
    • Whether the pool is busy or not.

      +

      Returns boolean

      The pool busyness boolean status.

      +
    • get empty(): boolean
    • Whether the pool is empty or not.

      +

      Returns boolean

      The pool emptiness boolean status.

      +
    • get full(): boolean
    • Whether the pool is full or not.

      +

      Returns boolean

      The pool fullness boolean status.

      +
    • get ready(): boolean
    • Whether the pool is ready or not.

      +

      Returns boolean

      The pool readiness boolean status.

      +
    • get type(): "fixed" | "dynamic"
    • The pool type.

      If it is 'dynamic', it provides the max property.

      -

      Returns "fixed" | "dynamic"

    • get utilization(): number
    • The approximate pool utilization.

      +

      Returns "fixed" | "dynamic"

    • get utilization(): number
    • The approximate pool utilization.

      Returns number

      The pool utilization.

      -
    • get worker(): "thread" | "cluster"
    • The worker type.

      -

      Returns "thread" | "cluster"

    Methods

    • Hook executed after the worker task execution. +

    • get worker(): "thread" | "cluster"
    • The worker type.

      +

      Returns "thread" | "cluster"

    Methods

    • Method hooked up after a worker node has been newly created. +

    Returns void

    • Hook executed before the worker task execution. +

    Returns void

    • Creates a new, completely set up dynamic worker node.

      +

    Returns void

    • Terminates the worker node given its worker node key.

      +

    Returns void

    • Gets the worker information given its worker node key.

      +

    Returns Promise<void>

    • Registers a listener callback on the worker given its worker node key.

      +

    Returns void

    • Sends the startup message to worker given its worker node key.

      +

    Returns void

    • Sends a message to worker given its worker node key.

      +

    Returns void

    • Setup hook to execute code before worker nodes are created in the abstract constructor. +

    Returns void

    \ No newline at end of file +

    Returns void

    \ No newline at end of file diff --git a/docs/classes/FixedPriorityQueue.html b/docs/classes/FixedPriorityQueue.html index bad5abd9..fa6e3ef2 100644 --- a/docs/classes/FixedPriorityQueue.html +++ b/docs/classes/FixedPriorityQueue.html @@ -1,6 +1,6 @@ -FixedPriorityQueue | poolifier - v4.0.14

    Class FixedPriorityQueue<T>Internal

    Fixed priority queue.

    +FixedPriorityQueue | poolifier - v4.0.15

    Class FixedPriorityQueue<T>Internal

    Fixed priority queue.

    Type Parameters

    • T

      Type of fixed priority queue data.

      -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    capacity enablePriority nodeArray @@ -22,27 +22,27 @@

    Default Value

    false
     
    -

    Properties

    capacity: number

    The fixed priority queue capacity.

    -
    enablePriority: boolean

    Whether to enable priority.

    -
    size: number

    The fixed priority queue size.

    -
    start: number

    Methods

    Properties

    capacity: number

    The fixed priority queue capacity.

    +
    enablePriority: boolean

    Whether to enable priority.

    +
    size: number

    The fixed priority queue size.

    +
    start: number

    Methods

    • Dequeue data from the fixed priority queue.

      +

    Returns void

    • Dequeue data from the fixed priority queue.

      Returns undefined | T

      The dequeued data or undefined if the priority queue is empty.

      -
    • Checks if the fixed priority queue is empty.

      Returns boolean

      true if the fixed priority queue is empty, false otherwise.

      -
    • Enqueue data into the fixed priority queue.

      Parameters

      • data: T

        Data to enqueue.

      • Optional priority: number

        Priority of the data. Lower values have higher priority.

      Returns number

      The new size of the priority queue.

      Throws

      If the fixed priority queue is full.

      -
    • Checks if the fixed priority queue is full.

      Returns boolean

      true if the fixed priority queue is full, false otherwise.

      -
    • Gets data from the fixed priority queue.

      Parameters

      • index: number

        The index of the data to get.

      Returns undefined | T

      The data at the index or undefined if the fixed priority queue is empty or the index is out of bounds.

      -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index 534d4408..a8a146ab 100644 --- a/docs/classes/FixedThreadPool.html +++ b/docs/classes/FixedThreadPool.html @@ -1,9 +1,9 @@ -FixedThreadPool | poolifier - v4.0.14

    Class FixedThreadPool<Data, Response>

    A thread pool with a fixed number of threads.

    +FixedThreadPool | poolifier - v4.0.15

    Class FixedThreadPool<Data, Response>

    A thread pool with a fixed number of threads.

    Author

    Alessandro Pio Ardizio

    Since

    0.0.1

    Type Parameters

    • Data = unknown

      Type of data sent to the worker. This can only be structured-cloneable data.

    • Response = unknown

      Type of execution response. This can only be structured-cloneable data.

      -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

  • filePath: string

    Path to an implementation of a ThreadWorker file, which can be relative or absolute.

  • opts: ThreadPoolOptions = {}

    Options for this fixed thread pool.

  • Optional maximumNumberOfThreads: number

    The maximum number of threads for this pool.

    -
  • Returns FixedThreadPool<Data, Response>

    Properties

    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. +

    Returns FixedThreadPool<Data, Response>

    Properties

    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. The async tracking tooling identifier is poolifier:<PoolType>-<WorkerType>-pool.

    Events that can currently be listened to:

      @@ -71,74 +71,76 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'taskError': Emitted when an error occurs while executing a task.
    • 'backPressure': Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size >= maximum queue size).
    -
    filePath: string

    Path to the worker file.

    -
    maximumNumberOfWorkers?: number

    Maximum number of workers that this pool manages.

    -
    minimumNumberOfWorkers: number

    Minimum number of workers that this pool manages.

    -
    opts: PoolOptions<Worker>

    Options for the pool.

    -
    promiseResponseMap: Map<`${string}-${string}-${string}-${string}-${string}`, PromiseResponseWrapper<Response>> = ...

    The task execution response promise map:

    +
    filePath: string

    Path to the worker file.

    +
    maximumNumberOfWorkers?: number

    Maximum number of workers that this pool manages.

    +
    minimumNumberOfWorkers: number

    Minimum number of workers that this pool manages.

    +
    opts: PoolOptions<Worker>

    Options for the pool.

    +
    promiseResponseMap: Map<`${string}-${string}-${string}-${string}-${string}`, PromiseResponseWrapper<Response>> = ...

    The task execution response promise map:

    • key: The message id of each submitted task.
    • value: An object that contains task's worker node key, execution response promise resolve and reject callbacks, async resource.

    When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id.

    -
    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

    -
    workerNodes: IWorkerNode<Worker, Data>[] = []

    Pool worker nodes.

    -

    Accessors

    • get busy(): boolean
    • Whether the pool is busy or not.

      -

      The pool busyness boolean status.

      -

      Returns boolean

    • get full(): boolean
    • Whether the pool is full or not.

      -

      The pool filling boolean status.

      -

      Returns boolean

    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

    +
    workerNodes: IWorkerNode<Worker, Data>[] = []

    Pool worker nodes.

    +

    Accessors

    • get busy(): boolean
    • Whether the pool is busy or not.

      +

      Returns boolean

      The pool busyness boolean status.

      +
    • get empty(): boolean
    • Whether the pool is empty or not.

      +

      Returns boolean

      The pool emptiness boolean status.

      +
    • get full(): boolean
    • Whether the pool is full or not.

      +

      Returns boolean

      The pool fullness boolean status.

      +
    • get ready(): boolean
    • Whether the pool is ready or not.

      +

      Returns boolean

      The pool readiness boolean status.

      +
    • get type(): "fixed" | "dynamic"
    • The pool type.

      If it is 'dynamic', it provides the max property.

      -

      Returns "fixed" | "dynamic"

    • get utilization(): number
    • The approximate pool utilization.

      +

      Returns "fixed" | "dynamic"

    • get utilization(): number
    • The approximate pool utilization.

      Returns number

      The pool utilization.

      -
    • get worker(): "thread" | "cluster"
    • The worker type.

      -

      Returns "thread" | "cluster"

    Methods

    • Hook executed after the worker task execution. +

    • get worker(): "thread" | "cluster"
    • The worker type.

      +

      Returns "thread" | "cluster"

    Methods

    • Method hooked up after a worker node has been newly created. +

    Returns void

    • Hook executed before the worker task execution. +

    Returns void

    • Creates a new, completely set up dynamic worker node.

      +

    Returns void

    • Terminates the worker node given its worker node key.

      +

    Returns void

    • Gets the worker information given its worker node key.

      +

    Returns Promise<void>

    • Registers a listener callback on the worker given its worker node key.

      +

    Returns void

    • Sends the startup message to worker given its worker node key.

      +

    Returns void

    • Sends a message to worker given its worker node key.

      +

    Returns void

    • Sends a message to worker given its worker node key.

      Parameters

      • workerNodeKey: number

        The worker node key.

      • message: MessageValue<Data, unknown>

        The message.

      • Optional transferList: readonly TransferListItem[]

        The optional array of transferable objects.

        -

      Returns void

    • Setup hook to execute code before worker nodes are created in the abstract constructor. +

    Returns void

    \ No newline at end of file +

    Returns void

    \ No newline at end of file diff --git a/docs/classes/PriorityQueue.html b/docs/classes/PriorityQueue.html index fbe63b9a..eef1b250 100644 --- a/docs/classes/PriorityQueue.html +++ b/docs/classes/PriorityQueue.html @@ -1,6 +1,6 @@ -PriorityQueue | poolifier - v4.0.14

    Class PriorityQueue<T>Internal

    Priority queue.

    +PriorityQueue | poolifier - v4.0.15

    Class PriorityQueue<T>Internal

    Priority queue.

    Type Parameters

    • T

      Type of priority queue data.

      -

    Constructors

    Constructors

    Properties

    bucketSize head maxSize @@ -20,18 +20,20 @@

    Default Value

    false
     
    -

    Properties

    bucketSize: number
    maxSize: number

    The priority queue maximum size.

    -

    Accessors

    Methods

    Properties

    bucketSize: number
    maxSize: number

    The priority queue maximum size.

    +

    Accessors

    • get buckets(): number
    • The number of filled prioritized buckets.

      +

      Returns number

      The number of filled prioritized buckets.

      +

    Methods

    • Dequeue data from the priority queue.

      Parameters

      • Optional bucket: number

        The prioritized bucket to dequeue from.

      Returns undefined | T

      The dequeued data or undefined if the priority queue is empty.

      -
    • Enqueue data into the priority queue.

      Parameters

      • data: T

        Data to enqueue.

      • Optional priority: number

        Priority of the data. Lower values have higher priority.

      Returns number

      The new size of the priority queue.

      -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/ThreadWorker.html b/docs/classes/ThreadWorker.html index 0786677b..8ea821d4 100644 --- a/docs/classes/ThreadWorker.html +++ b/docs/classes/ThreadWorker.html @@ -1,4 +1,4 @@ -ThreadWorker | poolifier - v4.0.14

    Class ThreadWorker<Data, Response>

    A thread worker used by a poolifier ThreadPool.

    +ThreadWorker | poolifier - v4.0.15

    Class ThreadWorker<Data, Response>

    A thread worker used by a poolifier ThreadPool.

    When this worker is inactive for more than the given maxInactiveTime, it will send a termination request to its main thread.

    If you use a DynamicThreadPool the extra workers that were created will be terminated, @@ -7,7 +7,7 @@ but the minimum number of workers will be guaranteed.

    Since

    0.0.1

    Type Parameters

    • Data = unknown

      Type of data this worker receives from pool's execution. This can only be structured-cloneable data.

    • Response = unknown

      Type of response the worker sends back to the main thread. This can only be structured-cloneable data.

      -

    Hierarchy (view full)

    Constructors

    Hierarchy (view full)

    Constructors

    Properties

    activeInterval? isMain lastTaskTimestamp @@ -35,51 +35,51 @@ but the minimum number of workers will be guaranteed.

    Constructors

    Properties

    activeInterval?: Timeout

    Handler id of the activeInterval worker activity check.

    -
    isMain: undefined | boolean

    Whether this is the main worker or not.

    -
    lastTaskTimestamp: number

    Timestamp of the last task processed by this worker.

    -
    opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

    Options for the worker.

    -
    port?: MessagePort

    Message port used to communicate with the main worker.

    -
    statistics?: WorkerStatistics

    Performance statistics computation requirements.

    -
    taskFunctions: Map<string, TaskFunctionObject<Data, Response>>

    Task function object(s) processed by the worker when the pool's execution function is invoked.

    -

    Accessors

    Methods

    Returns ThreadWorker<Data, Response>

    Properties

    activeInterval?: Timeout

    Handler id of the activeInterval worker activity check.

    +
    isMain: undefined | boolean

    Whether this is the main worker or not.

    +
    lastTaskTimestamp: number

    Timestamp of the last task processed by this worker.

    +
    opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

    Options for the worker.

    +
    port?: MessagePort

    Message port used to communicate with the main worker.

    +
    statistics?: WorkerStatistics

    Performance statistics computation requirements.

    +
    taskFunctions: Map<string, TaskFunctionObject<Data, Response>>

    Task function object(s) processed by the worker when the pool's execution function is invoked.

    +

    Accessors

    Methods

    • Handles an error and convert it to a string so it can be sent back to the main worker.

      Parameters

      • error: string | Error

        The error raised by the worker.

      Returns string

      The error message.

      -
    • Handles the ready message sent by the main worker.

      +

    Returns void

    Returns void

    Returns void

    • Runs the given task function asynchronously.

      +

    Returns void

    • Runs the given task function synchronously.

      +

    Returns void

    • Sends a message to main worker.

      +

    Returns void

    Returns void

    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/classes/WorkerChoiceStrategiesContext.html b/docs/classes/WorkerChoiceStrategiesContext.html index dc69a732..c79831fd 100644 --- a/docs/classes/WorkerChoiceStrategiesContext.html +++ b/docs/classes/WorkerChoiceStrategiesContext.html @@ -1,8 +1,8 @@ -WorkerChoiceStrategiesContext | poolifier - v4.0.14

    Class WorkerChoiceStrategiesContext<Worker, Data, Response>

    The worker choice strategies context.

    +WorkerChoiceStrategiesContext | poolifier - v4.0.15

    Class WorkerChoiceStrategiesContext<Worker, Data, Response>

    The worker choice strategies context.

    Type Parameters

    • Worker extends IWorker

      Type of worker.

    • Data = unknown

      Type of data sent to the worker. This can only be structured-cloneable data.

    • Response = unknown

      Type of execution response. This can only be structured-cloneable data.

      -

    Constructors

    Constructors

    Properties

  • Optional opts: WorkerChoiceStrategyOptions

    The worker choice strategy options.

  • Returns WorkerChoiceStrategiesContext<Worker, Data, Response>

    Default Value

    [WorkerChoiceStrategies.ROUND_ROBIN]
     
    -

    Properties

    defaultWorkerChoiceStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

    The default worker choice strategy in the context.

    -

    The pool instance.

    -
    retries: number

    The maximum number of worker choice strategies execution retries.

    -
    retriesCount: number

    The number of worker choice strategies execution retries.

    -
    workerChoiceStrategies: Map<"ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN", IWorkerChoiceStrategy>

    The worker choice strategies registered in the context.

    -
    workerChoiceStrategiesPolicy: StrategyPolicy

    The active worker choice strategies in the context policy.

    -
    workerChoiceStrategiesTaskStatisticsRequirements: TaskStatisticsRequirements

    The active worker choice strategies in the context task statistics requirements.

    -

    Methods

    Properties

    defaultWorkerChoiceStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

    The default worker choice strategy in the context.

    +

    The pool instance.

    +
    retries: number

    The maximum number of worker choice strategies execution retries.

    +
    retriesCount: number

    The number of worker choice strategies execution retries.

    +
    workerChoiceStrategies: Map<"ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN", IWorkerChoiceStrategy>

    The worker choice strategies registered in the context.

    +
    workerChoiceStrategiesPolicy: StrategyPolicy

    The active worker choice strategies in the context policy.

    +
    workerChoiceStrategiesTaskStatisticsRequirements: TaskStatisticsRequirements

    The active worker choice strategies in the context task statistics requirements.

    +

    Methods

    • Adds a worker choice strategy to the context.

      Parameters

      • workerChoiceStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

        The worker choice strategy to add.

      • pool: IPool<Worker, Data, Response>

        The pool instance.

      • Optional opts: WorkerChoiceStrategyOptions

        The worker choice strategy options.

      Returns Map<"ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN", IWorkerChoiceStrategy>

      The worker choice strategies.

      -
    • Executes the given worker choice strategy in the context algorithm.

      Parameters

      • workerChoiceStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN" = ...

        The worker choice strategy algorithm to execute.

      Returns number

      The key of the worker node.

      Default Value

      this.defaultWorkerChoiceStrategy
       

      Throws

      https://nodejs.org/api/errors.html#class-error If after computed retries the worker node key is null or undefined.

      -
    • Removes a worker choice strategy from the context.

      Parameters

      • workerChoiceStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

        The worker choice strategy to remove.

      Returns boolean

      true if the worker choice strategy is removed, false otherwise.

      -
    • Sets the default worker choice strategy to use in the context.

      Parameters

      • workerChoiceStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

        The default worker choice strategy to set.

      • Optional opts: WorkerChoiceStrategyOptions

        The worker choice strategy options.

        -

      Returns void

    • Sets the active worker choice strategies in the context options.

      +

    Returns void

    • Synchronizes the active worker choice strategies in the context with the given worker choice strategies.

      +

    Returns void

    • Synchronizes the active worker choice strategies in the context with the given worker choice strategies.

      Parameters

      • workerChoiceStrategies: Set<"ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN">

        The worker choice strategies to synchronize.

      • Optional opts: WorkerChoiceStrategyOptions

        The worker choice strategy options.

        -

      Returns void

    • Updates the worker node key in the active worker choice strategies in the context internals.

      +

    Returns void

    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/functions/availableParallelism.html b/docs/functions/availableParallelism.html index 56353868..5029c18f 100644 --- a/docs/functions/availableParallelism.html +++ b/docs/functions/availableParallelism.html @@ -1,4 +1,4 @@ -availableParallelism | poolifier - v4.0.14

    Function availableParallelism

    • Returns safe host OS optimized estimate of the default amount of parallelism a pool should use. +availableParallelism | poolifier - v4.0.15

      Function availableParallelism

      • Returns safe host OS optimized estimate of the default amount of parallelism a pool should use. Always returns a value greater than zero.

        Returns number

        The host OS optimized maximum pool size.

        -
      \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/hierarchy.html b/docs/hierarchy.html index e7dbc7d8..b30a3651 100644 --- a/docs/hierarchy.html +++ b/docs/hierarchy.html @@ -1 +1 @@ -poolifier - v4.0.14
    \ No newline at end of file +poolifier - v4.0.15
    \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 5615d3e3..cf4c8ff8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,4 +1,4 @@ -poolifier - v4.0.14

    poolifier - v4.0.14

    Index

    Classes

    AbstractPool +poolifier - v4.0.15
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/EventLoopUtilizationMeasurementStatistics.html b/docs/interfaces/EventLoopUtilizationMeasurementStatistics.html index b19c6e54..636884fd 100644 --- a/docs/interfaces/EventLoopUtilizationMeasurementStatistics.html +++ b/docs/interfaces/EventLoopUtilizationMeasurementStatistics.html @@ -1,5 +1,5 @@ -EventLoopUtilizationMeasurementStatistics | poolifier - v4.0.14

    Interface EventLoopUtilizationMeasurementStatisticsInternal

    Event loop utilization measurement statistics.

    -
    interface EventLoopUtilizationMeasurementStatistics {
        active: MeasurementStatistics;
        idle: MeasurementStatistics;
        utilization?: number;
    }

    Properties

    active +EventLoopUtilizationMeasurementStatistics | poolifier - v4.0.15

    Interface EventLoopUtilizationMeasurementStatisticsInternal

    Event loop utilization measurement statistics.

    +
    interface EventLoopUtilizationMeasurementStatistics {
        active: MeasurementStatistics;
        idle: MeasurementStatistics;
        utilization?: number;
    }

    Properties

    utilization?: number
    \ No newline at end of file +

    Properties

    utilization?: number
    \ No newline at end of file diff --git a/docs/interfaces/FixedPriorityQueueNode.html b/docs/interfaces/FixedPriorityQueueNode.html index adfeca13..00b12a1f 100644 --- a/docs/interfaces/FixedPriorityQueueNode.html +++ b/docs/interfaces/FixedPriorityQueueNode.html @@ -1,5 +1,5 @@ -FixedPriorityQueueNode | poolifier - v4.0.14

    Interface FixedPriorityQueueNode<T>Internal

    Fixed priority queue node.

    +FixedPriorityQueueNode | poolifier - v4.0.15

    Interface FixedPriorityQueueNode<T>Internal

    Fixed priority queue node.

    interface FixedPriorityQueueNode<T> {
        data: T;
        priority: number;
    }

    Type Parameters

    • T

      Type of priority queue node data.

      -

    Properties

    Properties

    Properties

    data: T
    priority: number
    \ No newline at end of file +

    Properties

    data: T
    priority: number
    \ No newline at end of file diff --git a/docs/interfaces/IPool.html b/docs/interfaces/IPool.html index dbda0db6..356689c9 100644 --- a/docs/interfaces/IPool.html +++ b/docs/interfaces/IPool.html @@ -1,8 +1,8 @@ -IPool | poolifier - v4.0.14

    Interface IPool<Worker, Data, Response>

    Contract definition for a poolifier pool.

    +IPool | poolifier - v4.0.15

    Interface IPool<Worker, Data, Response>

    Contract definition for a poolifier pool.

    interface IPool<Worker, Data, Response> {
        addTaskFunction: ((name, fn) => Promise<boolean>);
        destroy: (() => Promise<void>);
        emitter?: EventEmitterAsyncResource;
        enableTasksQueue: ((enable, tasksQueueOptions?) => void);
        execute: ((data?, name?, transferList?) => Promise<Response>);
        hasTaskFunction: ((name) => boolean);
        info: PoolInfo;
        listTaskFunctionsProperties: (() => TaskFunctionProperties[]);
        mapExecute: ((data, name?, transferList?) => Promise<Response[]>);
        removeTaskFunction: ((name) => Promise<boolean>);
        setDefaultTaskFunction: ((name) => Promise<boolean>);
        setTasksQueueOptions: ((tasksQueueOptions) => void);
        setWorkerChoiceStrategy: ((workerChoiceStrategy, workerChoiceStrategyOptions?) => void);
        setWorkerChoiceStrategyOptions: ((workerChoiceStrategyOptions) => boolean);
        start: (() => void);
        workerNodes: IWorkerNode<Worker, Data>[];
    }

    Type Parameters

    • Worker extends IWorker

      Type of worker which manages this pool.

    • Data = unknown

      Type of data sent to the worker. This can only be structured-cloneable data.

    • Response = unknown

      Type of execution response. This can only be structured-cloneable data.

      -

    Implemented by

    Properties

    Implemented by

    Properties

    addTaskFunction destroy emitter? enableTasksQueue @@ -25,8 +25,8 @@ If a task function with the same name already exists, it will be overwritten.

    Returns Promise<boolean>

    Returns

    true if the task function was added, false otherwise.

    Throws

    https://nodejs.org/api/errors.html#class-typeerror If the name parameter is not a string or an empty string.

    Throws

    https://nodejs.org/api/errors.html#class-typeerror If the fn parameter is not a function or task function object.

    -
    destroy: (() => Promise<void>)

    Terminates all workers in this pool.

    -

    Type declaration

      • (): Promise<void>
      • Returns Promise<void>

    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. +

    destroy: (() => Promise<void>)

    Terminates all workers in this pool.

    +

    Type declaration

      • (): Promise<void>
      • Returns Promise<void>

    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. The async tracking tooling identifier is poolifier:<PoolType>-<WorkerType>-pool.

    Events that can currently be listened to:

      @@ -39,39 +39,39 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'taskError': Emitted when an error occurs while executing a task.
    • 'backPressure': Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size >= maximum queue size).
    -
    enableTasksQueue: ((enable, tasksQueueOptions?) => void)

    Enables/disables the worker node tasks queue in this pool.

    +
    enableTasksQueue: ((enable, tasksQueueOptions?) => void)

    Enables/disables the worker node tasks queue in this pool.

    Type declaration

      • (enable, tasksQueueOptions?): void
      • Parameters

        • enable: boolean

          Whether to enable or disable the worker node tasks queue.

        • Optional tasksQueueOptions: TasksQueueOptions

          The worker node tasks queue options.

          -

        Returns void

    execute: ((data?, name?, transferList?) => Promise<Response>)

    Executes the specified function in the worker constructor with the task data input parameter.

    +

    Returns void

    execute: ((data?, name?, transferList?) => Promise<Response>)

    Executes the specified function in the worker constructor with the task data input parameter.

    Type declaration

      • (data?, name?, transferList?): Promise<Response>
      • Parameters

        • Optional data: Data

          The optional task input data for the specified task function. This can only be structured-cloneable data.

        • Optional name: string

          The optional name of the task function to execute. If not specified, the default task function will be executed.

        • Optional transferList: readonly TransferListItem[]

          An optional array of transferable objects to transfer ownership of. Ownership of the transferred objects is given to the chosen pool's worker_threads worker and they should not be used in the main thread afterwards.

        Returns Promise<Response>

    Returns

    Promise with a task function response that will be fulfilled when the task is completed.

    -
    hasTaskFunction: ((name) => boolean)

    Whether the specified task function exists in this pool.

    +
    hasTaskFunction: ((name) => boolean)

    Whether the specified task function exists in this pool.

    Type declaration

      • (name): boolean
      • Parameters

        • name: string

          The name of the task function.

        Returns boolean

    Returns

    true if the task function exists, false otherwise.

    -
    info: PoolInfo

    Pool information.

    -
    listTaskFunctionsProperties: (() => TaskFunctionProperties[])

    Lists the properties of task functions available in this pool.

    +
    info: PoolInfo

    Pool information.

    +
    listTaskFunctionsProperties: (() => TaskFunctionProperties[])

    Lists the properties of task functions available in this pool.

    Type declaration

    Returns

    The properties of task functions available in this pool.

    -
    mapExecute: ((data, name?, transferList?) => Promise<Response[]>)

    Executes the specified function in the worker constructor with the tasks data iterable input parameter.

    +
    mapExecute: ((data, name?, transferList?) => Promise<Response[]>)

    Executes the specified function in the worker constructor with the tasks data iterable input parameter.

    Type declaration

      • (data, name?, transferList?): Promise<Response[]>
      • Parameters

        • data: Iterable<Data>

          The tasks iterable input data for the specified task function. This can only be an iterable of structured-cloneable data.

        • Optional name: string

          The optional name of the task function to execute. If not specified, the default task function will be executed.

        • Optional transferList: readonly TransferListItem[]

          An optional array of transferable objects to transfer ownership of. Ownership of the transferred objects is given to the chosen pool's worker_threads worker and they should not be used in the main thread afterwards.

        Returns Promise<Response[]>

    Returns

    Promise with an array of task function responses that will be fulfilled when the tasks are completed.

    -
    removeTaskFunction: ((name) => Promise<boolean>)

    Removes a task function from this pool.

    +
    removeTaskFunction: ((name) => Promise<boolean>)

    Removes a task function from this pool.

    Type declaration

      • (name): Promise<boolean>
      • Parameters

        • name: string

          The name of the task function.

        Returns Promise<boolean>

    Returns

    true if the task function was removed, false otherwise.

    -
    setDefaultTaskFunction: ((name) => Promise<boolean>)

    Sets the default task function in this pool.

    +
    setDefaultTaskFunction: ((name) => Promise<boolean>)

    Sets the default task function in this pool.

    Type declaration

      • (name): Promise<boolean>
      • Parameters

        • name: string

          The name of the task function.

        Returns Promise<boolean>

    Returns

    true if the default task function was set, false otherwise.

    -
    setTasksQueueOptions: ((tasksQueueOptions) => void)

    Sets the worker node tasks queue options in this pool.

    +
    setTasksQueueOptions: ((tasksQueueOptions) => void)

    Sets the worker node tasks queue options in this pool.

    Type declaration

      • (tasksQueueOptions): void
      • Parameters

        Returns void

    setWorkerChoiceStrategy: ((workerChoiceStrategy, workerChoiceStrategyOptions?) => void)

    Sets the default worker choice strategy in this pool.

    +

    Returns void

    setWorkerChoiceStrategy: ((workerChoiceStrategy, workerChoiceStrategyOptions?) => void)

    Sets the default worker choice strategy in this pool.

    Type declaration

      • (workerChoiceStrategy, workerChoiceStrategyOptions?): void
      • Parameters

        • workerChoiceStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

          The default worker choice strategy.

        • Optional workerChoiceStrategyOptions: WorkerChoiceStrategyOptions

          The worker choice strategy options.

          -

        Returns void

    setWorkerChoiceStrategyOptions: ((workerChoiceStrategyOptions) => boolean)

    Sets the worker choice strategy options in this pool.

    +

    Returns void

    setWorkerChoiceStrategyOptions: ((workerChoiceStrategyOptions) => boolean)

    Sets the worker choice strategy options in this pool.

    Type declaration

      • (workerChoiceStrategyOptions): boolean
      • Parameters

        Returns boolean

    Returns

    true if the worker choice strategy options were set, false otherwise.

    -
    start: (() => void)

    Starts the minimum number of workers in this pool.

    -

    Type declaration

      • (): void
      • Returns void

    workerNodes: IWorkerNode<Worker, Data>[]

    Pool worker nodes.

    -
    \ No newline at end of file +
    start: (() => void)

    Starts the minimum number of workers in this pool.

    +

    Type declaration

      • (): void
      • Returns void

    workerNodes: IWorkerNode<Worker, Data>[]

    Pool worker nodes.

    +
    \ No newline at end of file diff --git a/docs/interfaces/IWorker.html b/docs/interfaces/IWorker.html index 305e4b4e..00b6ccfe 100644 --- a/docs/interfaces/IWorker.html +++ b/docs/interfaces/IWorker.html @@ -1,5 +1,5 @@ -IWorker | poolifier - v4.0.14

    Interface IWorker

    Worker interface.

    -
    interface IWorker {
        disconnect?: (() => void);
        id?: number;
        kill?: ((signal?) => void);
        on: ((event, handler) => this);
        once: ((event, handler) => this);
        terminate?: (() => Promise<number>);
        threadId?: number;
        unref?: (() => void);
        [captureRejectionSymbol]?<K>(error, event, ...args): void;
        addListener<K>(eventName, listener): this;
        emit<K>(eventName, ...args): boolean;
        eventNames(): (string | symbol)[];
        getMaxListeners(): number;
        listenerCount<K>(eventName, listener?): number;
        listeners<K>(eventName): Function[];
        off<K>(eventName, listener): this;
        prependListener<K>(eventName, listener): this;
        prependOnceListener<K>(eventName, listener): this;
        rawListeners<K>(eventName): Function[];
        removeAllListeners(eventName?): this;
        removeListener<K>(eventName, listener): this;
        setMaxListeners(n): this;
    }

    Hierarchy

    • EventEmitter
      • IWorker

    Properties

    disconnect? +IWorker | poolifier - v4.0.15

    Interface IWorker

    Worker interface.

    +
    interface IWorker {
        disconnect?: (() => void);
        id?: number;
        kill?: ((signal?) => void);
        on: ((event, handler) => this);
        once: ((event, handler) => this);
        terminate?: (() => Promise<number>);
        threadId?: number;
        unref?: (() => void);
        [captureRejectionSymbol]?<K>(error, event, ...args): void;
        addListener<K>(eventName, listener): this;
        emit<K>(eventName, ...args): boolean;
        eventNames(): (string | symbol)[];
        getMaxListeners(): number;
        listenerCount<K>(eventName, listener?): number;
        listeners<K>(eventName): Function[];
        off<K>(eventName, listener): this;
        prependListener<K>(eventName, listener): this;
        prependOnceListener<K>(eventName, listener): this;
        rawListeners<K>(eventName): Function[];
        removeAllListeners(eventName?): this;
        removeListener<K>(eventName, listener): this;
        setMaxListeners(n): this;
    }

    Hierarchy

    • EventEmitter
      • IWorker

    Properties

    Properties

    disconnect?: (() => void)

    Cluster worker disconnect.

    -

    Type declaration

      • (): void
      • Returns void

    id?: number

    Cluster worker id.

    -
    kill?: ((signal?) => void)

    Cluster worker kill.

    -

    Type declaration

      • (signal?): void
      • Parameters

        • Optional signal: string

        Returns void

    on: ((event, handler) => this)

    Registers an event handler.

    +

    Type declaration

      • (): void
      • Returns void

    id?: number

    Cluster worker id.

    +
    kill?: ((signal?) => void)

    Cluster worker kill.

    +

    Type declaration

      • (signal?): void
      • Parameters

        • Optional signal: string

        Returns void

    on: ((event, handler) => this)

    Registers an event handler.

    Type declaration

      • (event, handler): this
      • Parameters

        Returns this

    once: ((event, handler) => this)

    Registers once an event handler.

    +

    Returns this

    once: ((event, handler) => this)

    Registers once an event handler.

    Type declaration

      • (event, handler): this
      • Parameters

        Returns this

    terminate?: (() => Promise<number>)

    Stop all JavaScript execution in the worker thread as soon as possible. +

    Returns this

    terminate?: (() => Promise<number>)

    Stop all JavaScript execution in the worker thread as soon as possible. Returns a Promise for the exit code that is fulfilled when the 'exit' event is emitted.

    -

    Type declaration

      • (): Promise<number>
      • Returns Promise<number>

    threadId?: number

    Worker thread worker id.

    -
    unref?: (() => void)

    Calling unref() on a worker allows the thread to exit if this is the only +

    Type declaration

      • (): Promise<number>
      • Returns Promise<number>

    threadId?: number

    Worker thread worker id.

    +
    unref?: (() => void)

    Calling unref() on a worker allows the thread to exit if this is the only active handle in the event system. If the worker is already unref()ed callingunref() again has no effect.

    Type declaration

      • (): void
      • Returns void

    Since

    v10.5.0

    -

    Methods

    • Type Parameters

      • K

      Parameters

      • error: Error
      • event: string | symbol
      • Rest ...args: AnyRest

      Returns void

    Methods

    • Type Parameters

      • K

      Parameters

      • error: Error
      • event: string | symbol
      • Rest ...args: AnyRest

      Returns void

    • Alias for emitter.on(eventName, listener).

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args) => void)
          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns this

      Since

      v0.1.26

      -
    • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments +

    • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

      Returns true if the event had listeners, false otherwise.

      import { EventEmitter } from 'node:events';
      const myEmitter = new EventEmitter();

      // First listener
      myEmitter.on('event', function firstListener() {
      console.log('Helloooo! first listener');
      });
      // Second listener
      myEmitter.on('event', function secondListener(arg1, arg2) {
      console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
      });
      // Third listener
      myEmitter.on('event', function thirdListener(...args) {
      const parameters = args.join(', ');
      console.log(`event with parameters ${parameters} in third listener`);
      });

      console.log(myEmitter.listeners('event'));

      myEmitter.emit('event', 1, 2, 3, 4, 5);

      // Prints:
      // [
      // [Function: firstListener],
      // [Function: secondListener],
      // [Function: thirdListener]
      // ]
      // Helloooo! first listener
      // event with parameters 1, 2 in second listener
      // event with parameters 1, 2, 3, 4, 5 in third listener

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • Rest ...args: AnyRest

      Returns boolean

      Since

      v0.1.26

      -
    • Returns an array listing the events for which the emitter has registered +

    • Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.

      import { EventEmitter } from 'node:events';

      const myEE = new EventEmitter();
      myEE.on('foo', () => {});
      myEE.on('bar', () => {});

      const sym = Symbol('symbol');
      myEE.on(sym, () => {});

      console.log(myEE.eventNames());
      // Prints: [ 'foo', 'bar', Symbol(symbol) ]

      Returns (string | symbol)[]

      Since

      v6.0.0

      -
    • Returns the current max listener value for the EventEmitter which is either +

    • Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

      Returns number

      Since

      v1.0.0

      -
    • Returns the number of listeners listening for the event named eventName. +

    • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event being listened for

      • Optional listener: Function

        The event handler function

      Returns number

      Since

      v3.2.0

      -
    • Returns a copy of the array of listeners for the event named eventName.

      +
    • Returns a copy of the array of listeners for the event named eventName.

      server.on('connection', (stream) => {
      console.log('someone connected!');
      });
      console.log(util.inspect(server.listeners('connection')));
      // Prints: [ [Function] ]

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      Since

      v0.1.26

      -
    • Alias for emitter.removeListener().

      +
    • Alias for emitter.removeListener().

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args) => void)
          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns this

      Since

      v10.0.0

      -
    • Adds the listener function to the beginning of the listeners array for the +

    • Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.

      @@ -74,7 +74,7 @@ and listener will result in the listener being added,

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

      • listener: ((...args) => void)

        The callback function

          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns this

      Since

      v6.0.0

      -
    • Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this +

    • Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.

      server.prependOnceListener('connection', (stream) => {
      console.log('Ah, we have our first user!');
      });
      @@ -82,18 +82,18 @@ listener is removed, and then invoked.

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

      • listener: ((...args) => void)

        The callback function

          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns this

      Since

      v6.0.0

      -
    • Returns a copy of the array of listeners for the event named eventName, +

    • Returns a copy of the array of listeners for the event named eventName, including any wrappers (such as those created by .once()).

      import { EventEmitter } from 'node:events';
      const emitter = new EventEmitter();
      emitter.once('log', () => console.log('log once'));

      // Returns a new Array with a function `onceWrapper` which has a property
      // `listener` which contains the original listener bound above
      const listeners = emitter.rawListeners('log');
      const logFnWrapper = listeners[0];

      // Logs "log once" to the console and does not unbind the `once` event
      logFnWrapper.listener();

      // Logs "log once" to the console and removes the listener
      logFnWrapper();

      emitter.on('log', () => console.log('log persistently'));
      // Will return a new Array with a single function bound by `.on()` above
      const newListeners = emitter.rawListeners('log');

      // Logs "log persistently" twice
      newListeners[0]();
      emitter.emit('log');

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      Since

      v9.4.0

      -
    • Removes all listeners, or those of the specified eventName.

      +
    • Removes all listeners, or those of the specified eventName.

      It is bad practice to remove listeners added elsewhere in the code, particularly when the EventEmitter instance was created by some other component or module (e.g. sockets or file streams).

      Returns a reference to the EventEmitter, so that calls can be chained.

      Parameters

      • Optional eventName: string | symbol

      Returns this

      Since

      v0.1.26

      -
    • Removes the specified listener from the listener array for the event named eventName.

      +
    • Removes the specified listener from the listener array for the event named eventName.

      const callback = (stream) => {
      console.log('someone connected!');
      };
      server.on('connection', callback);
      // ...
      server.removeListener('connection', callback);

      removeListener() will remove, at most, one instance of a listener from the @@ -117,10 +117,10 @@ recently added instance. In the example the once('ping') li

      Returns a reference to the EventEmitter, so that calls can be chained.

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args) => void)
          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns this

      Since

      v0.1.26

      -
    • By default EventEmitters will print a warning if more than 10 listeners are +

    • By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.

      Returns a reference to the EventEmitter, so that calls can be chained.

      Parameters

      • n: number

      Returns this

      Since

      v0.3.5

      -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/IWorkerChoiceStrategy.html b/docs/interfaces/IWorkerChoiceStrategy.html index 91f7b4c2..dea03eb8 100644 --- a/docs/interfaces/IWorkerChoiceStrategy.html +++ b/docs/interfaces/IWorkerChoiceStrategy.html @@ -1,5 +1,5 @@ -IWorkerChoiceStrategy | poolifier - v4.0.14

    Interface IWorkerChoiceStrategyInternal

    Worker choice strategy interface.

    -
    interface IWorkerChoiceStrategy {
        choose: (() => undefined | number);
        remove: ((workerNodeKey) => boolean);
        reset: (() => boolean);
        setOptions: ((opts) => void);
        strategyPolicy: StrategyPolicy;
        taskStatisticsRequirements: TaskStatisticsRequirements;
        update: ((workerNodeKey) => boolean);
    }

    Properties

    choose +IWorkerChoiceStrategy | poolifier - v4.0.15

    Interface IWorkerChoiceStrategyInternal

    Worker choice strategy interface.

    +
    interface IWorkerChoiceStrategy {
        choose: (() => undefined | number);
        remove: ((workerNodeKey) => boolean);
        reset: (() => boolean);
        setOptions: ((opts) => void);
        strategyPolicy: StrategyPolicy;
        taskStatisticsRequirements: TaskStatisticsRequirements;
        update: ((workerNodeKey) => boolean);
    }

    Properties

    choose remove reset setOptions @@ -10,16 +10,16 @@ If no worker nodes are not eligible, undefined is returned. If undefined is returned, the caller retry.

    Type declaration

      • (): undefined | number
      • Returns undefined | number

    Returns

    The worker node key or undefined.

    -
    remove: ((workerNodeKey) => boolean)

    Removes the worker node key from strategy internals.

    +
    remove: ((workerNodeKey) => boolean)

    Removes the worker node key from strategy internals.

    Type declaration

      • (workerNodeKey): boolean
      • Parameters

        • workerNodeKey: number

          The worker node key.

        Returns boolean

    Returns

    true if the worker node key is removed, false otherwise.

    -
    reset: (() => boolean)

    Resets strategy internals.

    +
    reset: (() => boolean)

    Resets strategy internals.

    Type declaration

      • (): boolean
      • Returns boolean

    Returns

    true if the reset is successful, false otherwise.

    -
    setOptions: ((opts) => void)

    Sets the worker choice strategy options.

    +
    setOptions: ((opts) => void)

    Sets the worker choice strategy options.

    Type declaration

    strategyPolicy: StrategyPolicy

    Strategy policy.

    -
    taskStatisticsRequirements: TaskStatisticsRequirements

    Tasks statistics requirements.

    -
    update: ((workerNodeKey) => boolean)

    Updates the worker node key strategy internals. +

    Returns void

    strategyPolicy: StrategyPolicy

    Strategy policy.

    +
    taskStatisticsRequirements: TaskStatisticsRequirements

    Tasks statistics requirements.

    +
    update: ((workerNodeKey) => boolean)

    Updates the worker node key strategy internals. This is called after a task has been executed on a worker node.

    Type declaration

      • (workerNodeKey): boolean
      • Parameters

        • workerNodeKey: number

        Returns boolean

    Returns

    true if the update is successful, false otherwise.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/IWorkerNode.html b/docs/interfaces/IWorkerNode.html index a545c9ea..634c9d4c 100644 --- a/docs/interfaces/IWorkerNode.html +++ b/docs/interfaces/IWorkerNode.html @@ -1,7 +1,7 @@ -IWorkerNode | poolifier - v4.0.14

    Interface IWorkerNode<Worker, Data>Internal

    Worker node interface.

    +IWorkerNode | poolifier - v4.0.15

    Interface IWorkerNode<Worker, Data>Internal

    Worker node interface.

    interface IWorkerNode<Worker, Data> {
        clearTasksQueue: (() => void);
        deleteTaskFunctionWorkerUsage: ((name) => boolean);
        dequeueLastPrioritizedTask: (() => undefined | Task<Data>);
        dequeueTask: ((bucket?) => undefined | Task<Data>);
        enqueueTask: ((task) => number);
        getTaskFunctionWorkerUsage: ((name) => undefined | WorkerUsage);
        hasBackPressure: (() => boolean);
        info: WorkerInfo;
        messageChannel?: MessageChannel;
        registerOnceWorkerEventHandler: ((event, handler) => void);
        registerWorkerEventHandler: ((event, handler) => void);
        setTasksQueuePriority: ((enablePriority) => void);
        strategyData?: StrategyData;
        tasksQueueBackPressureSize: number;
        tasksQueueSize: (() => number);
        terminate: (() => Promise<void>);
        usage: WorkerUsage;
        worker: Worker;
        [captureRejectionSymbol]?<K>(error, event, ...args): void;
        addListener<K>(eventName, listener): this;
        emit<K>(eventName, ...args): boolean;
        eventNames(): (string | symbol)[];
        getMaxListeners(): number;
        listenerCount<K>(eventName, listener?): number;
        listeners<K>(eventName): Function[];
        off<K>(eventName, listener): this;
        on<K>(eventName, listener): this;
        once<K>(eventName, listener): this;
        prependListener<K>(eventName, listener): this;
        prependOnceListener<K>(eventName, listener): this;
        rawListeners<K>(eventName): Function[];
        removeAllListeners(eventName?): this;
        removeListener<K>(eventName, listener): this;
        setMaxListeners(n): this;
    }

    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

    • EventEmitter
      • IWorkerNode

    Properties

    Hierarchy

    • EventEmitter
      • IWorkerNode

    Properties

    clearTasksQueue: (() => void)

    Clears tasks queue.

    -

    Type declaration

      • (): void
      • Returns void

    deleteTaskFunctionWorkerUsage: ((name) => boolean)

    Deletes task function worker usage statistics.

    +

    Type declaration

      • (): void
      • Returns void

    deleteTaskFunctionWorkerUsage: ((name) => boolean)

    Deletes task function worker usage statistics.

    Type declaration

      • (name): boolean
      • Parameters

        • name: string

          The task function name.

        Returns boolean

    Returns

    true if the task function worker usage statistics were deleted, false otherwise.

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

    Dequeue last prioritized task.

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

    Dequeue last prioritized task.

    Type declaration

    Returns

    The dequeued task.

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

    Dequeue task.

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

    Dequeue task.

    Type declaration

      • (bucket?): undefined | Task<Data>
      • Parameters

        • Optional bucket: number

          The prioritized bucket to dequeue from.

        Returns undefined | Task<Data>

    Default Value

    0
     

    Returns

    The dequeued task.

    -
    enqueueTask: ((task) => number)

    Enqueue task.

    +
    enqueueTask: ((task) => number)

    Enqueue task.

    Type declaration

      • (task): number
      • Parameters

        Returns number

    Returns

    The tasks queue size.

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

    Gets task function worker usage statistics.

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

    Gets task function worker usage statistics.

    Type declaration

    Returns

    The task function worker usage statistics if the task function worker usage statistics are initialized, undefined otherwise.

    -
    hasBackPressure: (() => boolean)

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

    +
    hasBackPressure: (() => boolean)

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

    Type declaration

      • (): boolean
      • Returns boolean

    Returns

    true if the worker node has back pressure, false otherwise.

    -

    Worker info.

    -
    messageChannel?: MessageChannel

    Message channel (worker thread only).

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

    Registers once a worker event handler.

    +

    Worker info.

    +
    messageChannel?: MessageChannel

    Message channel (worker thread only).

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

    Registers once a worker event handler.

    Type declaration

      • (event, handler): void
      • Parameters

        Returns void

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

    Registers a worker event handler.

    +

    Returns void

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

    Registers a worker event handler.

    Type declaration

      • (event, handler): void
      • Parameters

        Returns void

    setTasksQueuePriority: ((enablePriority) => void)

    Sets tasks queue priority.

    +

    Returns void

    setTasksQueuePriority: ((enablePriority) => void)

    Sets tasks queue priority.

    Type declaration

      • (enablePriority): void
      • Parameters

        • enablePriority: boolean

          Whether to enable tasks queue priority.

          -

        Returns void

    strategyData?: StrategyData

    Worker choice strategy data. +

    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)

    Tasks queue size.

    +
    tasksQueueSize: (() => number)

    Tasks queue size.

    Type declaration

      • (): number
      • Returns number

    Returns

    The tasks queue size.

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

    Terminates the worker node.

    -

    Type declaration

      • (): Promise<void>
      • Returns Promise<void>

    Worker usage statistics.

    -
    worker: Worker

    Worker.

    -

    Methods

    • Type Parameters

      • K

      Parameters

      • error: Error
      • event: string | symbol
      • Rest ...args: AnyRest

      Returns void

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

    Terminates the worker node.

    +

    Type declaration

      • (): Promise<void>
      • Returns Promise<void>

    Worker usage statistics.

    +
    worker: Worker

    Worker.

    +

    Methods

    • Type Parameters

      • K

      Parameters

      • error: Error
      • event: string | symbol
      • Rest ...args: AnyRest

      Returns void

    • Alias for emitter.on(eventName, listener).

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args) => void)
          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns this

      Since

      v0.1.26

      -
    • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments +

    • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

      Returns true if the event had listeners, false otherwise.

      import { EventEmitter } from 'node:events';
      const myEmitter = new EventEmitter();

      // First listener
      myEmitter.on('event', function firstListener() {
      console.log('Helloooo! first listener');
      });
      // Second listener
      myEmitter.on('event', function secondListener(arg1, arg2) {
      console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
      });
      // Third listener
      myEmitter.on('event', function thirdListener(...args) {
      const parameters = args.join(', ');
      console.log(`event with parameters ${parameters} in third listener`);
      });

      console.log(myEmitter.listeners('event'));

      myEmitter.emit('event', 1, 2, 3, 4, 5);

      // Prints:
      // [
      // [Function: firstListener],
      // [Function: secondListener],
      // [Function: thirdListener]
      // ]
      // Helloooo! first listener
      // event with parameters 1, 2 in second listener
      // event with parameters 1, 2, 3, 4, 5 in third listener

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • Rest ...args: AnyRest

      Returns boolean

      Since

      v0.1.26

      -
    • Returns an array listing the events for which the emitter has registered +

    • Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.

      import { EventEmitter } from 'node:events';

      const myEE = new EventEmitter();
      myEE.on('foo', () => {});
      myEE.on('bar', () => {});

      const sym = Symbol('symbol');
      myEE.on(sym, () => {});

      console.log(myEE.eventNames());
      // Prints: [ 'foo', 'bar', Symbol(symbol) ]

      Returns (string | symbol)[]

      Since

      v6.0.0

      -
    • Returns the current max listener value for the EventEmitter which is either +

    • Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

      Returns number

      Since

      v1.0.0

      -
    • Returns the number of listeners listening for the event named eventName. +

    • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event being listened for

      • Optional listener: Function

        The event handler function

      Returns number

      Since

      v3.2.0

      -
    • Returns a copy of the array of listeners for the event named eventName.

      +
    • Returns a copy of the array of listeners for the event named eventName.

      server.on('connection', (stream) => {
      console.log('someone connected!');
      });
      console.log(util.inspect(server.listeners('connection')));
      // Prints: [ [Function] ]

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      Since

      v0.1.26

      -
    • Alias for emitter.removeListener().

      +
    • Alias for emitter.removeListener().

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args) => void)
          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns this

      Since

      v10.0.0

      -
    • Adds the listener function to the end of the listeners array for the event +

    • Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.

      @@ -115,7 +115,7 @@ event listener to the beginning of the listeners array.

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

      • listener: ((...args) => void)

        The callback function

          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns this

      Since

      v0.1.101

      -
    • Adds a one-time listener function for the event named eventName. The +

    • Adds a one-time listener function for the event named eventName. The next time eventName is triggered, this listener is removed and then invoked.

      server.once('connection', (stream) => {
      console.log('Ah, we have our first user!');
      });
      @@ -127,7 +127,7 @@ event listener to the beginning of the listeners array.

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

      • listener: ((...args) => void)

        The callback function

          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns this

      Since

      v0.3.0

      -
    • Adds the listener function to the beginning of the listeners array for the +

    • Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.

      @@ -137,7 +137,7 @@ and listener will result in the listener being added,

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

      • listener: ((...args) => void)

        The callback function

          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns this

      Since

      v6.0.0

      -
    • Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this +

    • Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.

      server.prependOnceListener('connection', (stream) => {
      console.log('Ah, we have our first user!');
      });
      @@ -145,18 +145,18 @@ listener is removed, and then invoked.

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

      • listener: ((...args) => void)

        The callback function

          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns this

      Since

      v6.0.0

      -
    • Returns a copy of the array of listeners for the event named eventName, +

    • Returns a copy of the array of listeners for the event named eventName, including any wrappers (such as those created by .once()).

      import { EventEmitter } from 'node:events';
      const emitter = new EventEmitter();
      emitter.once('log', () => console.log('log once'));

      // Returns a new Array with a function `onceWrapper` which has a property
      // `listener` which contains the original listener bound above
      const listeners = emitter.rawListeners('log');
      const logFnWrapper = listeners[0];

      // Logs "log once" to the console and does not unbind the `once` event
      logFnWrapper.listener();

      // Logs "log once" to the console and removes the listener
      logFnWrapper();

      emitter.on('log', () => console.log('log persistently'));
      // Will return a new Array with a single function bound by `.on()` above
      const newListeners = emitter.rawListeners('log');

      // Logs "log persistently" twice
      newListeners[0]();
      emitter.emit('log');

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      Since

      v9.4.0

      -
    • Removes all listeners, or those of the specified eventName.

      +
    • Removes all listeners, or those of the specified eventName.

      It is bad practice to remove listeners added elsewhere in the code, particularly when the EventEmitter instance was created by some other component or module (e.g. sockets or file streams).

      Returns a reference to the EventEmitter, so that calls can be chained.

      Parameters

      • Optional eventName: string | symbol

      Returns this

      Since

      v0.1.26

      -
    • Removes the specified listener from the listener array for the event named eventName.

      +
    • Removes the specified listener from the listener array for the event named eventName.

      const callback = (stream) => {
      console.log('someone connected!');
      };
      server.on('connection', callback);
      // ...
      server.removeListener('connection', callback);

      removeListener() will remove, at most, one instance of a listener from the @@ -180,10 +180,10 @@ recently added instance. In the example the once('ping') li

      Returns a reference to the EventEmitter, so that calls can be chained.

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args) => void)
          • (...args): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns this

      Since

      v0.1.26

      -
    • By default EventEmitters will print a warning if more than 10 listeners are +

    • By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.

      Returns a reference to the EventEmitter, so that calls can be chained.

      Parameters

      • n: number

      Returns this

      Since

      v0.3.5

      -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/MeasurementOptions.html b/docs/interfaces/MeasurementOptions.html index 207a861a..1bf8b26b 100644 --- a/docs/interfaces/MeasurementOptions.html +++ b/docs/interfaces/MeasurementOptions.html @@ -1,4 +1,4 @@ -MeasurementOptions | poolifier - v4.0.14

    Interface MeasurementOptions

    Measurement options.

    -
    interface MeasurementOptions {
        median: boolean;
    }

    Properties

    median +MeasurementOptions | poolifier - v4.0.15

    Interface MeasurementOptions

    Measurement options.

    +
    interface MeasurementOptions {
        median: boolean;
    }

    Properties

    Properties

    median: boolean

    Set measurement median.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/MeasurementStatistics.html b/docs/interfaces/MeasurementStatistics.html index 7fe4ff7b..dca4542f 100644 --- a/docs/interfaces/MeasurementStatistics.html +++ b/docs/interfaces/MeasurementStatistics.html @@ -1,14 +1,14 @@ -MeasurementStatistics | poolifier - v4.0.14

    Interface MeasurementStatisticsInternal

    Measurement statistics.

    -
    interface MeasurementStatistics {
        aggregate?: number;
        average?: number;
        history: CircularBuffer;
        maximum?: number;
        median?: number;
        minimum?: number;
    }

    Properties

    aggregate? +MeasurementStatistics | poolifier - v4.0.15

    Interface MeasurementStatisticsInternal

    Measurement statistics.

    +
    interface MeasurementStatistics {
        aggregate?: number;
        average?: number;
        history: CircularBuffer;
        maximum?: number;
        median?: number;
        minimum?: number;
    }

    Properties

    aggregate?: number

    Measurement aggregate.

    -
    average?: number

    Measurement average.

    -

    Measurement history.

    -
    maximum?: number

    Measurement maximum.

    -
    median?: number

    Measurement median.

    -
    minimum?: number

    Measurement minimum.

    -
    \ No newline at end of file +
    average?: number

    Measurement average.

    +

    Measurement history.

    +
    maximum?: number

    Measurement maximum.

    +
    median?: number

    Measurement median.

    +
    minimum?: number

    Measurement minimum.

    +
    \ No newline at end of file diff --git a/docs/interfaces/MeasurementStatisticsRequirements.html b/docs/interfaces/MeasurementStatisticsRequirements.html index 7658b4d7..a63586c8 100644 --- a/docs/interfaces/MeasurementStatisticsRequirements.html +++ b/docs/interfaces/MeasurementStatisticsRequirements.html @@ -1,8 +1,8 @@ -MeasurementStatisticsRequirements | poolifier - v4.0.14

    Interface MeasurementStatisticsRequirementsInternal

    Measurement statistics requirements.

    -
    interface MeasurementStatisticsRequirements {
        aggregate: boolean;
        average: boolean;
        median: boolean;
    }

    Properties

    aggregate +MeasurementStatisticsRequirements | poolifier - v4.0.15

    Interface MeasurementStatisticsRequirementsInternal

    Measurement statistics requirements.

    +
    interface MeasurementStatisticsRequirements {
        aggregate: boolean;
        average: boolean;
        median: boolean;
    }

    Properties

    aggregate: boolean

    Requires measurement aggregate.

    -
    average: boolean

    Requires measurement average.

    -
    median: boolean

    Requires measurement median.

    -
    \ No newline at end of file +
    average: boolean

    Requires measurement average.

    +
    median: boolean

    Requires measurement median.

    +
    \ No newline at end of file diff --git a/docs/interfaces/MessageValue.html b/docs/interfaces/MessageValue.html index b696f315..29d07e88 100644 --- a/docs/interfaces/MessageValue.html +++ b/docs/interfaces/MessageValue.html @@ -1,7 +1,7 @@ -MessageValue | poolifier - v4.0.14

    Interface MessageValue<Data, ErrorData>Internal

    Message object that is passed between main worker and worker.

    +MessageValue | poolifier - v4.0.15

    Interface MessageValue<Data, ErrorData>Internal

    Message object that is passed between main worker and worker.

    interface MessageValue<Data, ErrorData> {
        checkActive?: boolean;
        data?: Data;
        kill?: true | "success" | "SOFT" | "HARD" | "failure";
        name?: string;
        port?: MessagePort;
        priority?: number;
        ready?: boolean;
        statistics?: WorkerStatistics;
        strategy?: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN";
        taskFunction?: string;
        taskFunctionOperation?: "add" | "default" | "remove";
        taskFunctionOperationStatus?: boolean;
        taskFunctionProperties?: TaskFunctionProperties;
        taskFunctionsProperties?: TaskFunctionProperties[];
        taskId?: `${string}-${string}-${string}-${string}-${string}`;
        taskPerformance?: TaskPerformance;
        timestamp?: number;
        transferList?: readonly TransferListItem[];
        workerError?: WorkerError<ErrorData>;
        workerId?: number;
    }

    Type Parameters

    • Data = unknown

      Type of data sent to the worker or execution response. This can only be structured-cloneable data.

    • ErrorData = unknown

      Type of data sent to the worker triggering an error. This can only be structured-cloneable data.

      -

    Hierarchy (view full)

    Properties

    Hierarchy (view full)

    Properties

    Properties

    checkActive?: boolean

    Whether the worker starts or stops its activity check.

    -
    data?: Data

    Task input data that will be passed to the worker.

    -
    kill?: true | "success" | "SOFT" | "HARD" | "failure"

    Kill code.

    -
    name?: string

    Task name.

    -
    port?: MessagePort

    Message port.

    -
    priority?: number

    Task priority. Lower values have higher priority.

    +
    data?: Data

    Task input data that will be passed to the worker.

    +
    kill?: true | "success" | "SOFT" | "HARD" | "failure"

    Kill code.

    +
    name?: string

    Task name.

    +
    port?: MessagePort

    Message port.

    +
    priority?: number

    Task priority. Lower values have higher priority.

    Default Value

    0
     
    -
    ready?: boolean

    Whether the worker is ready or not.

    -
    statistics?: WorkerStatistics

    Whether the worker computes the given statistics or not.

    -
    strategy?: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

    Task worker choice strategy.

    -
    taskFunction?: string

    Task function serialized to string.

    -
    taskFunctionOperation?: "add" | "default" | "remove"

    Task function operation:

    +
    ready?: boolean

    Whether the worker is ready or not.

    +
    statistics?: WorkerStatistics

    Whether the worker computes the given statistics or not.

    +
    strategy?: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

    Task worker choice strategy.

    +
    taskFunction?: string

    Task function serialized to string.

    +
    taskFunctionOperation?: "add" | "default" | "remove"

    Task function operation:

    • 'add' - Add a task function.
    • 'remove' - Remove a task function.
    • 'default' - Set a task function as default.
    -
    taskFunctionOperationStatus?: boolean

    Whether the task function operation is successful or not.

    -
    taskFunctionProperties?: TaskFunctionProperties

    Task function properties.

    -
    taskFunctionsProperties?: TaskFunctionProperties[]

    Task functions properties.

    -
    taskId?: `${string}-${string}-${string}-${string}-${string}`

    Task UUID.

    -
    taskPerformance?: TaskPerformance

    Task performance.

    -
    timestamp?: number

    Timestamp.

    -
    transferList?: readonly TransferListItem[]

    Array of transferable objects.

    -
    workerError?: WorkerError<ErrorData>

    Worker error.

    -
    workerId?: number

    Worker id.

    -
    \ No newline at end of file +
    taskFunctionOperationStatus?: boolean

    Whether the task function operation is successful or not.

    +
    taskFunctionProperties?: TaskFunctionProperties

    Task function properties.

    +
    taskFunctionsProperties?: TaskFunctionProperties[]

    Task functions properties.

    +
    taskId?: `${string}-${string}-${string}-${string}-${string}`

    Task UUID.

    +
    taskPerformance?: TaskPerformance

    Task performance.

    +
    timestamp?: number

    Timestamp.

    +
    transferList?: readonly TransferListItem[]

    Array of transferable objects.

    +
    workerError?: WorkerError<ErrorData>

    Worker error.

    +
    workerId?: number

    Worker id.

    +
    \ No newline at end of file diff --git a/docs/interfaces/PoolInfo.html b/docs/interfaces/PoolInfo.html index dfd94682..da65e3f1 100644 --- a/docs/interfaces/PoolInfo.html +++ b/docs/interfaces/PoolInfo.html @@ -1,5 +1,5 @@ -PoolInfo | poolifier - v4.0.14

    Interface PoolInfo

    Pool information.

    -
    interface PoolInfo {
        backPressure?: boolean;
        busyWorkerNodes: number;
        defaultStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN";
        elu?: {
            active: {
                average?: number;
                maximum: number;
                median?: number;
                minimum: number;
            };
            idle: {
                average?: number;
                maximum: number;
                median?: number;
                minimum: number;
            };
            utilization: {
                average?: number;
                median?: number;
            };
        };
        executedTasks: number;
        executingTasks: number;
        failedTasks: number;
        idleWorkerNodes: number;
        maxQueuedTasks?: number;
        maxSize: number;
        minSize: number;
        queuedTasks?: number;
        ready: boolean;
        runTime?: {
            average?: number;
            maximum: number;
            median?: number;
            minimum: number;
        };
        started: boolean;
        stealingWorkerNodes?: number;
        stolenTasks?: number;
        strategyRetries: number;
        type: "fixed" | "dynamic";
        utilization?: number;
        version: string;
        waitTime?: {
            average?: number;
            maximum: number;
            median?: number;
            minimum: number;
        };
        worker: "thread" | "cluster";
        workerNodes: number;
    }

    Properties

    backPressure? +PoolInfo | poolifier - v4.0.15

    Interface PoolInfo

    Pool information.

    +
    interface PoolInfo {
        backPressure?: boolean;
        busyWorkerNodes: number;
        defaultStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN";
        elu?: {
            active: {
                average?: number;
                maximum: number;
                median?: number;
                minimum: number;
            };
            idle: {
                average?: number;
                maximum: number;
                median?: number;
                minimum: number;
            };
            utilization: {
                average?: number;
                median?: number;
            };
        };
        executedTasks: number;
        executingTasks: number;
        failedTasks: number;
        idleWorkerNodes: number;
        maxQueuedTasks?: number;
        maxSize: number;
        minSize: number;
        queuedTasks?: number;
        ready: boolean;
        runTime?: {
            average?: number;
            maximum: number;
            median?: number;
            minimum: number;
        };
        started: boolean;
        stealingWorkerNodes?: number;
        stolenTasks?: number;
        strategyRetries: number;
        type: "fixed" | "dynamic";
        utilization?: number;
        version: string;
        waitTime?: {
            average?: number;
            maximum: number;
            median?: number;
            minimum: number;
        };
        worker: "thread" | "cluster";
        workerNodes: number;
    }

    Properties

    backPressure?: boolean
    busyWorkerNodes: number

    Pool busy worker nodes.

    -
    defaultStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
    elu?: {
        active: {
            average?: number;
            maximum: number;
            median?: number;
            minimum: number;
        };
        idle: {
            average?: number;
            maximum: number;
            median?: number;
            minimum: number;
        };
        utilization: {
            average?: number;
            median?: number;
        };
    }

    Type declaration

    • active: {
          average?: number;
          maximum: number;
          median?: number;
          minimum: number;
      }
      • Optional Readonly average?: number
      • Readonly maximum: number
      • Optional Readonly median?: number
      • Readonly minimum: number
    • idle: {
          average?: number;
          maximum: number;
          median?: number;
          minimum: number;
      }
      • Optional Readonly average?: number
      • Readonly maximum: number
      • Optional Readonly median?: number
      • Readonly minimum: number
    • utilization: {
          average?: number;
          median?: number;
      }
      • Optional Readonly average?: number
      • Optional Readonly median?: number
    executedTasks: number
    executingTasks: number
    failedTasks: number
    idleWorkerNodes: number

    Pool idle worker nodes.

    -
    maxQueuedTasks?: number
    maxSize: number
    minSize: number
    queuedTasks?: number
    ready: boolean
    runTime?: {
        average?: number;
        maximum: number;
        median?: number;
        minimum: number;
    }

    Type declaration

    • Optional Readonly average?: number
    • Readonly maximum: number
    • Optional Readonly median?: number
    • Readonly minimum: number
    started: boolean
    stealingWorkerNodes?: number

    Pool stealing worker nodes.

    -
    stolenTasks?: number
    strategyRetries: number
    type: "fixed" | "dynamic"
    utilization?: number

    Pool utilization.

    -
    version: string
    waitTime?: {
        average?: number;
        maximum: number;
        median?: number;
        minimum: number;
    }

    Type declaration

    • Optional Readonly average?: number
    • Readonly maximum: number
    • Optional Readonly median?: number
    • Readonly minimum: number
    worker: "thread" | "cluster"
    workerNodes: number

    Pool total worker nodes.

    -
    \ No newline at end of file +

    Properties

    backPressure?: boolean
    busyWorkerNodes: number

    Pool busy worker nodes.

    +
    defaultStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
    elu?: {
        active: {
            average?: number;
            maximum: number;
            median?: number;
            minimum: number;
        };
        idle: {
            average?: number;
            maximum: number;
            median?: number;
            minimum: number;
        };
        utilization: {
            average?: number;
            median?: number;
        };
    }

    Type declaration

    • active: {
          average?: number;
          maximum: number;
          median?: number;
          minimum: number;
      }
      • Optional Readonly average?: number
      • Readonly maximum: number
      • Optional Readonly median?: number
      • Readonly minimum: number
    • idle: {
          average?: number;
          maximum: number;
          median?: number;
          minimum: number;
      }
      • Optional Readonly average?: number
      • Readonly maximum: number
      • Optional Readonly median?: number
      • Readonly minimum: number
    • utilization: {
          average?: number;
          median?: number;
      }
      • Optional Readonly average?: number
      • Optional Readonly median?: number
    executedTasks: number
    executingTasks: number
    failedTasks: number
    idleWorkerNodes: number

    Pool idle worker nodes.

    +
    maxQueuedTasks?: number
    maxSize: number
    minSize: number
    queuedTasks?: number
    ready: boolean
    runTime?: {
        average?: number;
        maximum: number;
        median?: number;
        minimum: number;
    }

    Type declaration

    • Optional Readonly average?: number
    • Readonly maximum: number
    • Optional Readonly median?: number
    • Readonly minimum: number
    started: boolean
    stealingWorkerNodes?: number

    Pool stealing worker nodes.

    +
    stolenTasks?: number
    strategyRetries: number
    type: "fixed" | "dynamic"
    utilization?: number

    Pool utilization.

    +
    version: string
    waitTime?: {
        average?: number;
        maximum: number;
        median?: number;
        minimum: number;
    }

    Type declaration

    • Optional Readonly average?: number
    • Readonly maximum: number
    • Optional Readonly median?: number
    • Readonly minimum: number
    worker: "thread" | "cluster"
    workerNodes: number

    Pool total worker nodes.

    +
    \ No newline at end of file diff --git a/docs/interfaces/PoolOptions.html b/docs/interfaces/PoolOptions.html index 6b960ed0..757900b2 100644 --- a/docs/interfaces/PoolOptions.html +++ b/docs/interfaces/PoolOptions.html @@ -1,6 +1,6 @@ -PoolOptions | poolifier - v4.0.14

    Interface PoolOptions<Worker>

    Options for a poolifier pool.

    +PoolOptions | poolifier - v4.0.15

    Interface PoolOptions<Worker>

    Options for a poolifier pool.

    interface PoolOptions<Worker> {
        enableEvents?: boolean;
        enableTasksQueue?: boolean;
        env?: Record<string, unknown>;
        errorHandler?: ErrorHandler<Worker>;
        exitHandler?: ExitHandler<Worker>;
        messageHandler?: MessageHandler<Worker>;
        onlineHandler?: OnlineHandler<Worker>;
        restartWorkerOnError?: boolean;
        settings?: ClusterSettings;
        startWorkers?: boolean;
        tasksQueueOptions?: TasksQueueOptions;
        workerChoiceStrategy?: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN";
        workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions;
        workerOptions?: WorkerOptions;
    }

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -

    Properties

    Properties

    Properties

    enableEvents?: boolean

    Pool events integrated with async resource emission.

    Default Value

    true
     
    -
    enableTasksQueue?: boolean

    Pool worker node tasks queue.

    +
    enableTasksQueue?: boolean

    Pool worker node tasks queue.

    Default Value

    false
     
    -
    env?: Record<string, unknown>

    Key/value pairs to add to worker process environment.

    +
    env?: Record<string, unknown>

    Key/value pairs to add to worker process environment.

    errorHandler?: ErrorHandler<Worker>

    A function that will listen for error event on each worker.

    +
    errorHandler?: ErrorHandler<Worker>

    A function that will listen for error event on each worker.

    Default Value

    () => {}

    -
    exitHandler?: ExitHandler<Worker>

    A function that will listen for exit event on each worker.

    +
    exitHandler?: ExitHandler<Worker>

    A function that will listen for exit event on each worker.

    Default Value

    () => {}

    -
    messageHandler?: MessageHandler<Worker>

    A function that will listen for message event on each worker.

    +
    messageHandler?: MessageHandler<Worker>

    A function that will listen for message event on each worker.

    Default Value

    () => {}

    -
    onlineHandler?: OnlineHandler<Worker>

    A function that will listen for online event on each worker.

    +
    onlineHandler?: OnlineHandler<Worker>

    A function that will listen for online event on each worker.

    Default Value

    () => {}

    -
    restartWorkerOnError?: boolean

    Restart worker on error.

    -
    settings?: ClusterSettings

    Cluster settings.

    +
    restartWorkerOnError?: boolean

    Restart worker on error.

    +
    settings?: ClusterSettings

    Cluster settings.

    startWorkers?: boolean

    Whether to start the minimum number of workers at pool initialization.

    +
    startWorkers?: boolean

    Whether to start the minimum number of workers at pool initialization.

    Default Value

    true
     
    -
    tasksQueueOptions?: TasksQueueOptions

    Pool worker node tasks queue options.

    -
    workerChoiceStrategy?: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

    The default worker choice strategy to use in this pool.

    +
    tasksQueueOptions?: TasksQueueOptions

    Pool worker node tasks queue options.

    +
    workerChoiceStrategy?: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

    The default worker choice strategy to use in this pool.

    Default Value

    WorkerChoiceStrategies.ROUND_ROBIN
     
    -
    workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions

    The worker choice strategy options.

    -
    workerOptions?: WorkerOptions

    Worker options.

    +
    workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions

    The worker choice strategy options.

    +
    workerOptions?: WorkerOptions

    Worker options.

    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/PriorityQueueNode.html b/docs/interfaces/PriorityQueueNode.html index 4044e26e..1fd3b7d3 100644 --- a/docs/interfaces/PriorityQueueNode.html +++ b/docs/interfaces/PriorityQueueNode.html @@ -1,6 +1,6 @@ -PriorityQueueNode | poolifier - v4.0.14

    Interface PriorityQueueNode<T>Internal

    Priority queue node.

    +PriorityQueueNode | poolifier - v4.0.15

    Interface PriorityQueueNode<T>Internal

    Priority queue node.

    interface PriorityQueueNode<T> {
        capacity: number;
        enablePriority: boolean;
        next?: FixedPriorityQueue<T>;
        size: number;
        [iterator](): Iterator<T, any, undefined>;
        clear(): void;
        dequeue(): undefined | T;
        empty(): boolean;
        enqueue(data, priority?): number;
        full(): boolean;
        get(index): undefined | T;
    }

    Type Parameters

    • T

      Type of priority queue node data.

      -

    Hierarchy (view full)

    Properties

    Hierarchy (view full)

    Properties

    capacity enablePriority next? size @@ -12,24 +12,24 @@ full get

    Properties

    capacity: number

    The fixed priority queue capacity.

    -
    enablePriority: boolean

    Whether to enable priority.

    -
    size: number

    The fixed priority queue size.

    -

    Methods

    enablePriority: boolean

    Whether to enable priority.

    +
    size: number

    The fixed priority queue size.

    +

    Methods

    • Enqueue data into the fixed priority queue.

      Parameters

      • data: T

        Data to enqueue.

      • Optional priority: number

        Priority of the data. Lower values have higher priority.

      Returns number

      The new size of the priority queue.

      Throws

      If the fixed priority queue is full.

      -
    • Gets data from the fixed priority queue.

      Parameters

      • index: number

        The index of the data to get.

      Returns undefined | T

      The data at the index or undefined if the fixed priority queue is empty or the index is out of bounds.

      -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/PromiseResponseWrapper.html b/docs/interfaces/PromiseResponseWrapper.html index f9a73cc1..f79d16eb 100644 --- a/docs/interfaces/PromiseResponseWrapper.html +++ b/docs/interfaces/PromiseResponseWrapper.html @@ -1,11 +1,11 @@ -PromiseResponseWrapper | poolifier - v4.0.14

    Interface PromiseResponseWrapper<Response>Internal

    An object holding the task execution response promise resolve/reject callbacks.

    +PromiseResponseWrapper | poolifier - v4.0.15

    Interface PromiseResponseWrapper<Response>Internal

    An object holding the task execution response promise resolve/reject callbacks.

    interface PromiseResponseWrapper<Response> {
        asyncResource?: AsyncResource;
        reject: ((reason?) => void);
        resolve: ((value) => void);
        workerNodeKey: number;
    }

    Type Parameters

    • Response = unknown

      Type of execution response. This can only be structured-cloneable data.

      -

    Properties

    Properties

    asyncResource?: AsyncResource

    The asynchronous resource used to track the task execution.

    -
    reject: ((reason?) => void)

    Reject callback to reject the promise.

    -

    Type declaration

      • (reason?): void
      • Parameters

        • Optional reason: unknown

        Returns void

    resolve: ((value) => void)

    Resolve callback to fulfill the promise.

    -

    Type declaration

    workerNodeKey: number

    The worker node key executing the task.

    -
    \ No newline at end of file +
    reject: ((reason?) => void)

    Reject callback to reject the promise.

    +

    Type declaration

      • (reason?): void
      • Parameters

        • Optional reason: unknown

        Returns void

    resolve: ((value) => void)

    Resolve callback to fulfill the promise.

    +

    Type declaration

    workerNodeKey: number

    The worker node key executing the task.

    +
    \ No newline at end of file diff --git a/docs/interfaces/StrategyData.html b/docs/interfaces/StrategyData.html index 75227f00..7187fc2e 100644 --- a/docs/interfaces/StrategyData.html +++ b/docs/interfaces/StrategyData.html @@ -1,3 +1,3 @@ -StrategyData | poolifier - v4.0.14

    Interface StrategyDataInternal

    Worker choice strategy data.

    -
    interface StrategyData {
        virtualTaskEndTimestamp?: number;
    }

    Properties

    virtualTaskEndTimestamp?: number
    \ No newline at end of file +StrategyData | poolifier - v4.0.15

    Interface StrategyDataInternal

    Worker choice strategy data.

    +
    interface StrategyData {
        virtualTaskEndTimestamp?: number;
    }

    Properties

    virtualTaskEndTimestamp?: number
    \ No newline at end of file diff --git a/docs/interfaces/StrategyPolicy.html b/docs/interfaces/StrategyPolicy.html index 96d19882..22a02f89 100644 --- a/docs/interfaces/StrategyPolicy.html +++ b/docs/interfaces/StrategyPolicy.html @@ -1,6 +1,6 @@ -StrategyPolicy | poolifier - v4.0.14

    Interface StrategyPolicyInternal

    Strategy policy.

    -
    interface StrategyPolicy {
        dynamicWorkerReady: boolean;
        dynamicWorkerUsage: boolean;
    }

    Properties

    dynamicWorkerReady +StrategyPolicy | poolifier - v4.0.15

    Interface StrategyPolicyInternal

    Strategy policy.

    +
    interface StrategyPolicy {
        dynamicWorkerReady: boolean;
        dynamicWorkerUsage: boolean;
    }

    Properties

    dynamicWorkerReady: boolean

    Expects the newly created dynamic worker to be flagged as ready.

    -
    dynamicWorkerUsage: boolean

    Expects tasks execution on the newly created dynamic worker.

    -
    \ No newline at end of file +
    dynamicWorkerUsage: boolean

    Expects tasks execution on the newly created dynamic worker.

    +
    \ No newline at end of file diff --git a/docs/interfaces/Task.html b/docs/interfaces/Task.html index 10ec260c..787abddb 100644 --- a/docs/interfaces/Task.html +++ b/docs/interfaces/Task.html @@ -1,6 +1,6 @@ -Task | poolifier - v4.0.14

    Interface Task<Data>Internal

    Message object that is passed as a task between main worker and worker.

    +Task | poolifier - v4.0.15

    Interface Task<Data>Internal

    Message object that is passed as a task between main worker and worker.

    interface Task<Data> {
        data?: Data;
        name?: string;
        priority?: number;
        strategy?: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN";
        taskId?: `${string}-${string}-${string}-${string}-${string}`;
        timestamp?: number;
        transferList?: readonly TransferListItem[];
    }

    Type Parameters

    • Data = unknown

      Type of data sent to the worker. This can only be structured-cloneable data.

      -

    Hierarchy (view full)

    Properties

    Hierarchy (view full)

    Properties

    Properties

    data?: Data

    Task input data that will be passed to the worker.

    -
    name?: string

    Task name.

    -
    priority?: number

    Task priority. Lower values have higher priority.

    +
    name?: string

    Task name.

    +
    priority?: number

    Task priority. Lower values have higher priority.

    Default Value

    0
     
    -
    strategy?: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

    Task worker choice strategy.

    -
    taskId?: `${string}-${string}-${string}-${string}-${string}`

    Task UUID.

    -
    timestamp?: number

    Timestamp.

    -
    transferList?: readonly TransferListItem[]

    Array of transferable objects.

    -
    \ No newline at end of file +
    strategy?: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

    Task worker choice strategy.

    +
    taskId?: `${string}-${string}-${string}-${string}-${string}`

    Task UUID.

    +
    timestamp?: number

    Timestamp.

    +
    transferList?: readonly TransferListItem[]

    Array of transferable objects.

    +
    \ No newline at end of file diff --git a/docs/interfaces/TaskFunctionObject.html b/docs/interfaces/TaskFunctionObject.html index 7846ed33..4c40deb2 100644 --- a/docs/interfaces/TaskFunctionObject.html +++ b/docs/interfaces/TaskFunctionObject.html @@ -1,10 +1,10 @@ -TaskFunctionObject | poolifier - v4.0.14

    Interface TaskFunctionObject<Data, Response>

    Task function object.

    +TaskFunctionObject | poolifier - v4.0.15

    Interface TaskFunctionObject<Data, Response>

    Task function object.

    interface TaskFunctionObject<Data, Response> {
        priority?: number;
        strategy?: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN";
        taskFunction: TaskFunction<Data, Response>;
    }

    Type Parameters

    • Data = unknown

      Type of data sent to the worker. This can only be structured-cloneable data.

    • Response = unknown

      Type of execution response. This can only be structured-cloneable data.

      -

    Properties

    Properties

    priority?: number

    Task function priority. Lower values have higher priority.

    -
    strategy?: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

    Task function worker choice strategy.

    -
    taskFunction: TaskFunction<Data, Response>

    Task function.

    -
    \ No newline at end of file +
    strategy?: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

    Task function worker choice strategy.

    +
    taskFunction: TaskFunction<Data, Response>

    Task function.

    +
    \ No newline at end of file diff --git a/docs/interfaces/TaskFunctionOperationResult.html b/docs/interfaces/TaskFunctionOperationResult.html index 4f257017..e926cc2e 100644 --- a/docs/interfaces/TaskFunctionOperationResult.html +++ b/docs/interfaces/TaskFunctionOperationResult.html @@ -1,4 +1,4 @@ -TaskFunctionOperationResult | poolifier - v4.0.14

    Interface TaskFunctionOperationResult

    Task function operation result.

    -
    interface TaskFunctionOperationResult {
        error?: Error;
        status: boolean;
    }

    Properties

    error? +TaskFunctionOperationResult | poolifier - v4.0.15

    Interface TaskFunctionOperationResult

    Task function operation result.

    +
    interface TaskFunctionOperationResult {
        error?: Error;
        status: boolean;
    }

    Properties

    Properties

    error?: Error
    status: boolean
    \ No newline at end of file +

    Properties

    error?: Error
    status: boolean
    \ No newline at end of file diff --git a/docs/interfaces/TaskFunctionProperties.html b/docs/interfaces/TaskFunctionProperties.html index 1470f77f..648dfaa8 100644 --- a/docs/interfaces/TaskFunctionProperties.html +++ b/docs/interfaces/TaskFunctionProperties.html @@ -1,8 +1,8 @@ -TaskFunctionProperties | poolifier - v4.0.14

    Interface TaskFunctionProperties

    Task function properties.

    -
    interface TaskFunctionProperties {
        name: string;
        priority?: number;
        strategy?: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN";
    }

    Properties

    name +TaskFunctionProperties | poolifier - v4.0.15

    Interface TaskFunctionProperties

    Task function properties.

    +
    interface TaskFunctionProperties {
        name: string;
        priority?: number;
        strategy?: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN";
    }

    Properties

    name: string

    Task function name.

    -
    priority?: number

    Task function priority. Lower values have higher priority.

    -
    strategy?: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

    Task function worker choice strategy.

    -
    \ No newline at end of file +
    priority?: number

    Task function priority. Lower values have higher priority.

    +
    strategy?: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

    Task function worker choice strategy.

    +
    \ No newline at end of file diff --git a/docs/interfaces/TaskPerformance.html b/docs/interfaces/TaskPerformance.html index 22ffafe1..d3717824 100644 --- a/docs/interfaces/TaskPerformance.html +++ b/docs/interfaces/TaskPerformance.html @@ -1,10 +1,10 @@ -TaskPerformance | poolifier - v4.0.14

    Interface TaskPerformanceInternal

    Task performance.

    -
    interface TaskPerformance {
        elu?: EventLoopUtilization;
        name: string;
        runTime?: number;
        timestamp: number;
    }

    Properties

    elu? +TaskPerformance | poolifier - v4.0.15

    Interface TaskPerformanceInternal

    Task performance.

    +
    interface TaskPerformance {
        elu?: EventLoopUtilization;
        name: string;
        runTime?: number;
        timestamp: number;
    }

    Properties

    elu?: EventLoopUtilization

    Task event loop utilization.

    -
    name: string

    Task name.

    -
    runTime?: number

    Task runtime.

    -
    timestamp: number

    Task performance timestamp.

    -
    \ No newline at end of file +
    name: string

    Task name.

    +
    runTime?: number

    Task runtime.

    +
    timestamp: number

    Task performance timestamp.

    +
    \ No newline at end of file diff --git a/docs/interfaces/TaskStatistics.html b/docs/interfaces/TaskStatistics.html index 02d578fd..7c489f57 100644 --- a/docs/interfaces/TaskStatistics.html +++ b/docs/interfaces/TaskStatistics.html @@ -1,5 +1,5 @@ -TaskStatistics | poolifier - v4.0.14

    Interface TaskStatisticsInternal

    Task statistics.

    -
    interface TaskStatistics {
        executed: number;
        executing: number;
        failed: number;
        maxQueued?: number;
        queued: number;
        sequentiallyStolen: number;
        stolen: number;
    }

    Properties

    executed +TaskStatistics | poolifier - v4.0.15

    Interface TaskStatisticsInternal

    Task statistics.

    +
    interface TaskStatistics {
        executed: number;
        executing: number;
        failed: number;
        maxQueued?: number;
        queued: number;
        sequentiallyStolen: number;
        stolen: number;
    }

    Properties

    executed: number

    Number of executed tasks.

    -
    executing: number

    Number of executing tasks.

    -
    failed: number

    Number of failed tasks.

    -
    maxQueued?: number

    Maximum number of queued tasks.

    -
    queued: number

    Number of queued tasks.

    -
    sequentiallyStolen: number

    Number of sequentially stolen tasks.

    -
    stolen: number

    Number of stolen tasks.

    -
    \ No newline at end of file +
    executing: number

    Number of executing tasks.

    +
    failed: number

    Number of failed tasks.

    +
    maxQueued?: number

    Maximum number of queued tasks.

    +
    queued: number

    Number of queued tasks.

    +
    sequentiallyStolen: number

    Number of sequentially stolen tasks.

    +
    stolen: number

    Number of stolen tasks.

    +
    \ No newline at end of file diff --git a/docs/interfaces/TaskStatisticsRequirements.html b/docs/interfaces/TaskStatisticsRequirements.html index 6d2b3f4d..17b05404 100644 --- a/docs/interfaces/TaskStatisticsRequirements.html +++ b/docs/interfaces/TaskStatisticsRequirements.html @@ -1,8 +1,8 @@ -TaskStatisticsRequirements | poolifier - v4.0.14

    Interface TaskStatisticsRequirementsInternal

    Pool worker node worker usage statistics requirements.

    -
    interface TaskStatisticsRequirements {
        elu: MeasurementStatisticsRequirements;
        runTime: MeasurementStatisticsRequirements;
        waitTime: MeasurementStatisticsRequirements;
    }

    Properties

    elu +TaskStatisticsRequirements | poolifier - v4.0.15

    Interface TaskStatisticsRequirementsInternal

    Pool worker node worker usage statistics requirements.

    +
    interface TaskStatisticsRequirements {
        elu: MeasurementStatisticsRequirements;
        runTime: MeasurementStatisticsRequirements;
        waitTime: MeasurementStatisticsRequirements;
    }

    Properties

    Properties

    Tasks event loop utilization requirements.

    -

    Tasks runtime requirements.

    -

    Tasks wait time requirements.

    -
    \ No newline at end of file +

    Tasks runtime requirements.

    +

    Tasks wait time requirements.

    +
    \ No newline at end of file diff --git a/docs/interfaces/TasksQueueOptions.html b/docs/interfaces/TasksQueueOptions.html index 3e68f6af..750a6cc7 100644 --- a/docs/interfaces/TasksQueueOptions.html +++ b/docs/interfaces/TasksQueueOptions.html @@ -1,5 +1,5 @@ -TasksQueueOptions | poolifier - v4.0.14

    Interface TasksQueueOptions

    Worker node tasks queue options.

    -
    interface TasksQueueOptions {
        concurrency?: number;
        size?: number;
        taskStealing?: boolean;
        tasksFinishedTimeout?: number;
        tasksStealingOnBackPressure?: boolean;
    }

    Properties

    concurrency? +TasksQueueOptions | poolifier - v4.0.15

    Interface TasksQueueOptions

    Worker node tasks queue options.

    +
    interface TasksQueueOptions {
        concurrency?: number;
        size?: number;
        taskStealing?: boolean;
        tasksFinishedTimeout?: number;
        tasksStealingOnBackPressure?: boolean;
    }

    Properties

    concurrency?: number

    Maximum number of tasks that can be executed concurrently on a worker node.

    Default Value

    1
     
    -
    size?: number

    Maximum tasks queue size per worker node flagging it as back pressured.

    +
    size?: number

    Maximum tasks queue size per worker node flagging it as back pressured.

    Default Value

    (pool maximum size)^2
     
    -
    taskStealing?: boolean

    Whether to enable task stealing on idle.

    +
    taskStealing?: boolean

    Whether to enable task stealing on idle.

    Default Value

    true
     
    -
    tasksFinishedTimeout?: number

    Queued tasks finished timeout in milliseconds at worker node termination.

    +
    tasksFinishedTimeout?: number

    Queued tasks finished timeout in milliseconds at worker node termination.

    Default Value

    2000
     
    -
    tasksStealingOnBackPressure?: boolean

    Whether to enable tasks stealing under back pressure.

    +
    tasksStealingOnBackPressure?: boolean

    Whether to enable tasks stealing under back pressure.

    Default Value

    false
     
    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/WorkerChoiceStrategyOptions.html b/docs/interfaces/WorkerChoiceStrategyOptions.html index 2faee930..3b40a5da 100644 --- a/docs/interfaces/WorkerChoiceStrategyOptions.html +++ b/docs/interfaces/WorkerChoiceStrategyOptions.html @@ -1,5 +1,5 @@ -WorkerChoiceStrategyOptions | poolifier - v4.0.14

    Interface WorkerChoiceStrategyOptions

    Worker choice strategy options.

    -
    interface WorkerChoiceStrategyOptions {
        elu?: MeasurementOptions;
        measurement?: "runTime" | "waitTime" | "elu";
        runTime?: MeasurementOptions;
        waitTime?: MeasurementOptions;
        weights?: Record<number, number>;
    }

    Properties

    elu? +WorkerChoiceStrategyOptions | poolifier - v4.0.15

    Interface WorkerChoiceStrategyOptions

    Worker choice strategy options.

    +
    interface WorkerChoiceStrategyOptions {
        elu?: MeasurementOptions;
        measurement?: "runTime" | "waitTime" | "elu";
        runTime?: MeasurementOptions;
        waitTime?: MeasurementOptions;
        weights?: Record<number, number>;
    }

    Properties

    elu? measurement? runTime? waitTime? @@ -7,15 +7,15 @@

    Properties

    Event loop utilization options.

    Default Value

    { median: false }
     
    -
    measurement?: "runTime" | "waitTime" | "elu"

    Measurement to use in worker choice strategy supporting it.

    -

    Runtime options.

    +
    measurement?: "runTime" | "waitTime" | "elu"

    Measurement to use in worker choice strategy supporting it.

    +

    Runtime options.

    Default Value

    { median: false }
     
    -

    Wait time options.

    +

    Wait time options.

    Default Value

    { median: false }
     
    -
    weights?: Record<number, number>

    Worker weights to use for weighted round robin worker selection strategies. +

    weights?: Record<number, number>

    Worker weights to use for weighted round robin worker selection strategies. A weight is tasks maximum execution time in milliseconds for a worker node.

    Default Value

    Weights computed automatically given the CPU performance.
     
    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/WorkerError.html b/docs/interfaces/WorkerError.html index d9506e59..9ab5ea57 100644 --- a/docs/interfaces/WorkerError.html +++ b/docs/interfaces/WorkerError.html @@ -1,9 +1,9 @@ -WorkerError | poolifier - v4.0.14

    Interface WorkerError<Data>

    Worker error.

    +WorkerError | poolifier - v4.0.15

    Interface WorkerError<Data>

    Worker error.

    interface WorkerError<Data> {
        data?: Data;
        message: string;
        name: string;
    }

    Type Parameters

    • Data = unknown

      Type of data sent to the worker triggering an error. This can only be structured-cloneable data.

      -

    Properties

    Properties

    Properties

    data?: Data

    Data triggering the error.

    -
    message: string

    Error message.

    -
    name: string

    Task function name triggering the error.

    -
    \ No newline at end of file +
    message: string

    Error message.

    +
    name: string

    Task function name triggering the error.

    +
    \ No newline at end of file diff --git a/docs/interfaces/WorkerInfo.html b/docs/interfaces/WorkerInfo.html index 19f99638..09f2098c 100644 --- a/docs/interfaces/WorkerInfo.html +++ b/docs/interfaces/WorkerInfo.html @@ -1,5 +1,5 @@ -WorkerInfo | poolifier - v4.0.14

    Interface WorkerInfoInternal

    Worker information.

    -
    interface WorkerInfo {
        backPressure: boolean;
        dynamic: boolean;
        id: undefined | number;
        ready: boolean;
        stealing: boolean;
        taskFunctionsProperties?: TaskFunctionProperties[];
        type: "thread" | "cluster";
    }

    Properties

    backPressure +WorkerInfo | poolifier - v4.0.15

    Interface WorkerInfoInternal

    Worker information.

    +
    interface WorkerInfo {
        backPressure: boolean;
        dynamic: boolean;
        id: undefined | number;
        ready: boolean;
        stealing: boolean;
        taskFunctionsProperties?: TaskFunctionProperties[];
        type: "thread" | "cluster";
    }

    Properties

    backPressure dynamic id ready @@ -8,11 +8,11 @@ type

    Properties

    backPressure: boolean

    Back pressure flag. This flag is set to true when worker node tasks queue has back pressure.

    -
    dynamic: boolean

    Dynamic flag.

    -
    id: undefined | number

    Worker id.

    -
    ready: boolean

    Ready flag.

    -
    stealing: boolean

    Stealing flag. +

    dynamic: boolean

    Dynamic flag.

    +
    id: undefined | number

    Worker id.

    +
    ready: boolean

    Ready flag.

    +
    stealing: boolean

    Stealing flag. This flag is set to true when worker node is stealing tasks from another worker node.

    -
    taskFunctionsProperties?: TaskFunctionProperties[]

    Task functions properties.

    -
    type: "thread" | "cluster"

    Worker type.

    -
    \ No newline at end of file +
    taskFunctionsProperties?: TaskFunctionProperties[]

    Task functions properties.

    +
    type: "thread" | "cluster"

    Worker type.

    +
    \ No newline at end of file diff --git a/docs/interfaces/WorkerNodeEventDetail.html b/docs/interfaces/WorkerNodeEventDetail.html index 28b4fc5d..153ded90 100644 --- a/docs/interfaces/WorkerNodeEventDetail.html +++ b/docs/interfaces/WorkerNodeEventDetail.html @@ -1,4 +1,4 @@ -WorkerNodeEventDetail | poolifier - v4.0.14

    Interface WorkerNodeEventDetailInternal

    Worker node event detail.

    -
    interface WorkerNodeEventDetail {
        workerId?: number;
        workerNodeKey?: number;
    }

    Properties

    workerId? +WorkerNodeEventDetail | poolifier - v4.0.15

    Interface WorkerNodeEventDetailInternal

    Worker node event detail.

    +
    interface WorkerNodeEventDetail {
        workerId?: number;
        workerNodeKey?: number;
    }

    Properties

    workerId?: number
    workerNodeKey?: number
    \ No newline at end of file +

    Properties

    workerId?: number
    workerNodeKey?: number
    \ No newline at end of file diff --git a/docs/interfaces/WorkerNodeOptions.html b/docs/interfaces/WorkerNodeOptions.html index 2e64941e..5cb40a26 100644 --- a/docs/interfaces/WorkerNodeOptions.html +++ b/docs/interfaces/WorkerNodeOptions.html @@ -1,7 +1,7 @@ -WorkerNodeOptions | poolifier - v4.0.14

    Interface WorkerNodeOptionsInternal

    Worker node options.

    -
    interface WorkerNodeOptions {
        env?: Record<string, unknown>;
        tasksQueueBackPressureSize: undefined | number;
        tasksQueueBucketSize: undefined | number;
        tasksQueuePriority: undefined | boolean;
        workerOptions?: WorkerOptions;
    }

    Properties

    env? +WorkerNodeOptions | poolifier - v4.0.15

    Interface WorkerNodeOptionsInternal

    Worker node options.

    +
    interface WorkerNodeOptions {
        env?: Record<string, unknown>;
        tasksQueueBackPressureSize: undefined | number;
        tasksQueueBucketSize: undefined | number;
        tasksQueuePriority: undefined | boolean;
        workerOptions?: WorkerOptions;
    }

    Properties

    env?: Record<string, unknown>
    tasksQueueBackPressureSize: undefined | number
    tasksQueueBucketSize: undefined | number
    tasksQueuePriority: undefined | boolean
    workerOptions?: WorkerOptions
    \ No newline at end of file +

    Properties

    env?: Record<string, unknown>
    tasksQueueBackPressureSize: undefined | number
    tasksQueueBucketSize: undefined | number
    tasksQueuePriority: undefined | boolean
    workerOptions?: WorkerOptions
    \ No newline at end of file diff --git a/docs/interfaces/WorkerOptions.html b/docs/interfaces/WorkerOptions.html index c8dbe2dd..162d56c3 100644 --- a/docs/interfaces/WorkerOptions.html +++ b/docs/interfaces/WorkerOptions.html @@ -1,5 +1,5 @@ -WorkerOptions | poolifier - v4.0.14

    Interface WorkerOptions

    Options for workers.

    -
    interface WorkerOptions {
        killBehavior?: "SOFT" | "HARD";
        killHandler?: KillHandler;
        maxInactiveTime?: number;
    }

    Properties

    killBehavior? +WorkerOptions | poolifier - v4.0.15

    Interface WorkerOptions

    Options for workers.

    +
    interface WorkerOptions {
        killBehavior?: "SOFT" | "HARD";
        killHandler?: KillHandler;
        maxInactiveTime?: number;
    }

    Properties

    killBehavior?: "SOFT" | "HARD"

    killBehavior dictates if your worker will be deleted in case a task is active on it.

    @@ -10,9 +10,9 @@

    This option only apply to the newly created workers.

    Default Value

    KillBehaviors.SOFT
     
    -
    killHandler?: KillHandler

    The function to call when a worker is killed.

    +
    killHandler?: KillHandler

    The function to call when a worker is killed.

    Default Value

    () => {}

    -
    maxInactiveTime?: number

    Maximum waiting time in milliseconds for tasks on newly created workers. It must be greater or equal than 5.

    +
    maxInactiveTime?: number

    Maximum waiting time in milliseconds for tasks on newly created workers. It must be greater or equal than 5.

    After this time, newly created workers will be terminated. The last active time of your worker will be updated when it terminates a task.

      @@ -22,4 +22,4 @@ when this timeout expires your tasks is interrupted before completion and remove

    Default Value

    60000
     
    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/WorkerStatistics.html b/docs/interfaces/WorkerStatistics.html index 81326004..6f9911e7 100644 --- a/docs/interfaces/WorkerStatistics.html +++ b/docs/interfaces/WorkerStatistics.html @@ -1,6 +1,6 @@ -WorkerStatistics | poolifier - v4.0.14

    Interface WorkerStatisticsInternal

    Worker task performance statistics computation settings.

    -
    interface WorkerStatistics {
        elu: boolean;
        runTime: boolean;
    }

    Properties

    elu +WorkerStatistics | poolifier - v4.0.15

    Interface WorkerStatisticsInternal

    Worker task performance statistics computation settings.

    +
    interface WorkerStatistics {
        elu: boolean;
        runTime: boolean;
    }

    Properties

    Properties

    elu: boolean

    Whether the worker computes the task event loop utilization (ELU) or not.

    -
    runTime: boolean

    Whether the worker computes the task runtime or not.

    -
    \ No newline at end of file +
    runTime: boolean

    Whether the worker computes the task runtime or not.

    +
    \ No newline at end of file diff --git a/docs/interfaces/WorkerUsage.html b/docs/interfaces/WorkerUsage.html index b72a63f9..02308be0 100644 --- a/docs/interfaces/WorkerUsage.html +++ b/docs/interfaces/WorkerUsage.html @@ -1,10 +1,10 @@ -WorkerUsage | poolifier - v4.0.14

    Interface WorkerUsageInternal

    Worker usage statistics.

    -
    interface WorkerUsage {
        elu: EventLoopUtilizationMeasurementStatistics;
        runTime: MeasurementStatistics;
        tasks: TaskStatistics;
        waitTime: MeasurementStatistics;
    }

    Properties

    elu +WorkerUsage | poolifier - v4.0.15

    Interface WorkerUsageInternal

    Worker usage statistics.

    +
    interface WorkerUsage {
        elu: EventLoopUtilizationMeasurementStatistics;
        runTime: MeasurementStatistics;
        tasks: TaskStatistics;
        waitTime: MeasurementStatistics;
    }

    Properties

    Tasks event loop utilization statistics.

    -

    Tasks runtime statistics.

    -

    Tasks statistics.

    -

    Tasks wait time statistics.

    -
    \ No newline at end of file +

    Tasks runtime statistics.

    +

    Tasks statistics.

    +

    Tasks wait time statistics.

    +
    \ No newline at end of file diff --git a/docs/types/ClusterPoolOptions.html b/docs/types/ClusterPoolOptions.html index f92b588a..8b40ce07 100644 --- a/docs/types/ClusterPoolOptions.html +++ b/docs/types/ClusterPoolOptions.html @@ -1,2 +1,2 @@ -ClusterPoolOptions | poolifier - v4.0.14

    Type alias ClusterPoolOptions

    ClusterPoolOptions: PoolOptions<Worker>

    Options for a poolifier cluster pool.

    -
    \ No newline at end of file +ClusterPoolOptions | poolifier - v4.0.15

    Type alias ClusterPoolOptions

    ClusterPoolOptions: PoolOptions<Worker>

    Options for a poolifier cluster pool.

    +
    \ No newline at end of file diff --git a/docs/types/ErrorHandler.html b/docs/types/ErrorHandler.html index 6b3fd777..fabbb7e5 100644 --- a/docs/types/ErrorHandler.html +++ b/docs/types/ErrorHandler.html @@ -1,3 +1,3 @@ -ErrorHandler | poolifier - v4.0.14

    Type alias ErrorHandler<Worker>

    ErrorHandler<Worker>: ((this, error) => void)

    Callback invoked if the worker raised an error.

    +ErrorHandler | poolifier - v4.0.15

    Type alias ErrorHandler<Worker>

    ErrorHandler<Worker>: ((this, error) => void)

    Callback invoked if the worker raised an error.

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -

    Type declaration

      • (this, error): void
      • Parameters

        Returns void

    \ No newline at end of file +

    Type declaration

      • (this, error): void
      • Parameters

        Returns void

    \ No newline at end of file diff --git a/docs/types/EventHandler.html b/docs/types/EventHandler.html index 91bf5de9..95b348d1 100644 --- a/docs/types/EventHandler.html +++ b/docs/types/EventHandler.html @@ -1,3 +1,3 @@ -EventHandler | poolifier - v4.0.14

    Type alias EventHandler<Worker>

    Worker event handler.

    +EventHandler | poolifier - v4.0.15

    Type alias EventHandler<Worker>

    Worker event handler.

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/types/ExitHandler.html b/docs/types/ExitHandler.html index 7f7c6da7..ee774d1e 100644 --- a/docs/types/ExitHandler.html +++ b/docs/types/ExitHandler.html @@ -1,3 +1,3 @@ -ExitHandler | poolifier - v4.0.14

    Type alias ExitHandler<Worker>

    ExitHandler<Worker>: ((this, exitCode) => void)

    Callback invoked when the worker exits successfully.

    +ExitHandler | poolifier - v4.0.15

    Type alias ExitHandler<Worker>

    ExitHandler<Worker>: ((this, exitCode) => void)

    Callback invoked when the worker exits successfully.

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -

    Type declaration

      • (this, exitCode): void
      • Parameters

        Returns void

    \ No newline at end of file +

    Type declaration

      • (this, exitCode): void
      • Parameters

        Returns void

    \ No newline at end of file diff --git a/docs/types/KillBehavior.html b/docs/types/KillBehavior.html index fa1d6e91..baeb5fee 100644 --- a/docs/types/KillBehavior.html +++ b/docs/types/KillBehavior.html @@ -1,2 +1,2 @@ -KillBehavior | poolifier - v4.0.14

    Type alias KillBehavior

    KillBehavior: keyof typeof KillBehaviors

    Kill behavior.

    -
    \ No newline at end of file +KillBehavior | poolifier - v4.0.15

    Type alias KillBehavior

    KillBehavior: keyof typeof KillBehaviors

    Kill behavior.

    +
    \ No newline at end of file diff --git a/docs/types/KillHandler.html b/docs/types/KillHandler.html index ec894e0a..f4f5c420 100644 --- a/docs/types/KillHandler.html +++ b/docs/types/KillHandler.html @@ -1,2 +1,2 @@ -KillHandler | poolifier - v4.0.14

    Type alias KillHandler

    KillHandler: (() => void | Promise<void>)

    Handler called when a worker is killed.

    -

    Type declaration

      • (): void | Promise<void>
      • Returns void | Promise<void>

    \ No newline at end of file +KillHandler | poolifier - v4.0.15

    Type alias KillHandler

    KillHandler: (() => void | Promise<void>)

    Handler called when a worker is killed.

    +

    Type declaration

      • (): void | Promise<void>
      • Returns void | Promise<void>

    \ No newline at end of file diff --git a/docs/types/Measurement.html b/docs/types/Measurement.html index a14a86c8..78ac30f9 100644 --- a/docs/types/Measurement.html +++ b/docs/types/Measurement.html @@ -1,2 +1,2 @@ -Measurement | poolifier - v4.0.14

    Type alias Measurement

    Measurement: keyof typeof Measurements

    Measurement.

    -
    \ No newline at end of file +Measurement | poolifier - v4.0.15

    Type alias Measurement

    Measurement: keyof typeof Measurements

    Measurement.

    +
    \ No newline at end of file diff --git a/docs/types/MessageHandler.html b/docs/types/MessageHandler.html index a5f578cf..d011868b 100644 --- a/docs/types/MessageHandler.html +++ b/docs/types/MessageHandler.html @@ -1,3 +1,3 @@ -MessageHandler | poolifier - v4.0.14

    Type alias MessageHandler<Worker>

    MessageHandler<Worker>: ((this, message) => void)

    Callback invoked if the worker has received a message.

    +MessageHandler | poolifier - v4.0.15

    Type alias MessageHandler<Worker>

    MessageHandler<Worker>: ((this, message) => void)

    Callback invoked if the worker has received a message.

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -

    Type declaration

      • (this, message): void
      • Parameters

        Returns void

    \ No newline at end of file +

    Type declaration

      • (this, message): void
      • Parameters

        Returns void

    \ No newline at end of file diff --git a/docs/types/OnlineHandler.html b/docs/types/OnlineHandler.html index d1037861..5cbf9d63 100644 --- a/docs/types/OnlineHandler.html +++ b/docs/types/OnlineHandler.html @@ -1,3 +1,3 @@ -OnlineHandler | poolifier - v4.0.14

    Type alias OnlineHandler<Worker>

    OnlineHandler<Worker>: ((this) => void)

    Callback invoked when the worker has started successfully.

    +OnlineHandler | poolifier - v4.0.15

    Type alias OnlineHandler<Worker>

    OnlineHandler<Worker>: ((this) => void)

    Callback invoked when the worker has started successfully.

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -

    Type declaration

      • (this): void
      • Parameters

        Returns void

    \ No newline at end of file +

    Type declaration

      • (this): void
      • Parameters

        Returns void

    \ No newline at end of file diff --git a/docs/types/PoolEvent.html b/docs/types/PoolEvent.html index cda69cce..b8e61a18 100644 --- a/docs/types/PoolEvent.html +++ b/docs/types/PoolEvent.html @@ -1,2 +1,2 @@ -PoolEvent | poolifier - v4.0.14

    Type alias PoolEvent

    PoolEvent: keyof typeof PoolEvents

    Pool event.

    -
    \ No newline at end of file +PoolEvent | poolifier - v4.0.15

    Type alias PoolEvent

    PoolEvent: keyof typeof PoolEvents

    Pool event.

    +
    \ No newline at end of file diff --git a/docs/types/PoolType.html b/docs/types/PoolType.html index 2b29a23d..059eeb96 100644 --- a/docs/types/PoolType.html +++ b/docs/types/PoolType.html @@ -1,2 +1,2 @@ -PoolType | poolifier - v4.0.14

    Type alias PoolType

    PoolType: keyof typeof PoolTypes

    Pool type.

    -
    \ No newline at end of file +PoolType | poolifier - v4.0.15

    Type alias PoolType

    PoolType: keyof typeof PoolTypes

    Pool type.

    +
    \ No newline at end of file diff --git a/docs/types/TaskAsyncFunction.html b/docs/types/TaskAsyncFunction.html index 055accb7..7df56d74 100644 --- a/docs/types/TaskAsyncFunction.html +++ b/docs/types/TaskAsyncFunction.html @@ -1,7 +1,7 @@ -TaskAsyncFunction | poolifier - v4.0.14

    Type alias TaskAsyncFunction<Data, Response>

    TaskAsyncFunction<Data, Response>: ((data?) => Promise<Response>)

    Task asynchronous function that can be executed. +TaskAsyncFunction | poolifier - v4.0.15

    Type alias TaskAsyncFunction<Data, Response>

    TaskAsyncFunction<Data, Response>: ((data?) => Promise<Response>)

    Task asynchronous function that can be executed. This function must return a promise.

    Type Parameters

    • Data = unknown

      Type of data sent to the worker. This can only be structured-cloneable data.

    • Response = unknown

      Type of execution response. This can only be structured-cloneable data.

    Type declaration

      • (data?): Promise<Response>
      • Parameters

        • Optional data: Data

          Data sent to the worker.

        Returns Promise<Response>

    Returns

    Execution response promise.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/types/TaskFunction.html b/docs/types/TaskFunction.html index 45564218..23d2e2e1 100644 --- a/docs/types/TaskFunction.html +++ b/docs/types/TaskFunction.html @@ -1,5 +1,5 @@ -TaskFunction | poolifier - v4.0.14

    Type alias TaskFunction<Data, Response>

    Task function that can be executed. +TaskFunction | poolifier - v4.0.15

    Type alias TaskFunction<Data, Response>

    Task function that can be executed. This function can be synchronous or asynchronous.

    Type Parameters

    • Data = unknown

      Type of data sent to the worker. This can only be structured-cloneable data.

    • Response = unknown

      Type of execution response. This can only be structured-cloneable data.

      -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/types/TaskFunctions.html b/docs/types/TaskFunctions.html index 03529864..9a00e505 100644 --- a/docs/types/TaskFunctions.html +++ b/docs/types/TaskFunctions.html @@ -1,6 +1,6 @@ -TaskFunctions | poolifier - v4.0.14

    Type alias TaskFunctions<Data, Response>

    TaskFunctions<Data, Response>: Record<string, TaskFunction<Data, Response> | TaskFunctionObject<Data, Response>>

    Tasks functions that can be executed. +TaskFunctions | poolifier - v4.0.15

    Type alias TaskFunctions<Data, Response>

    TaskFunctions<Data, Response>: Record<string, TaskFunction<Data, Response> | TaskFunctionObject<Data, Response>>

    Tasks functions that can be executed. The key is the name of the task function or task function object. The value is the task function or task function object.

    Type Parameters

    • Data = unknown

      Type of data sent to the worker. This can only be structured-cloneable data.

    • Response = unknown

      Type of execution response. This can only be structured-cloneable data.

      -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/types/TaskSyncFunction.html b/docs/types/TaskSyncFunction.html index 429ab4a6..69a642d5 100644 --- a/docs/types/TaskSyncFunction.html +++ b/docs/types/TaskSyncFunction.html @@ -1,6 +1,6 @@ -TaskSyncFunction | poolifier - v4.0.14

    Type alias TaskSyncFunction<Data, Response>

    TaskSyncFunction<Data, Response>: ((data?) => Response)

    Task synchronous function that can be executed.

    +TaskSyncFunction | poolifier - v4.0.15

    Type alias TaskSyncFunction<Data, Response>

    TaskSyncFunction<Data, Response>: ((data?) => Response)

    Task synchronous function that can be executed.

    Type Parameters

    • Data = unknown

      Type of data sent to the worker. This can only be structured-cloneable data.

    • Response = unknown

      Type of execution response. This can only be structured-cloneable data.

    Type declaration

    Returns

    Execution response.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/types/ThreadPoolOptions.html b/docs/types/ThreadPoolOptions.html index 52c478c3..59aca9b4 100644 --- a/docs/types/ThreadPoolOptions.html +++ b/docs/types/ThreadPoolOptions.html @@ -1,2 +1,2 @@ -ThreadPoolOptions | poolifier - v4.0.14

    Type alias ThreadPoolOptions

    ThreadPoolOptions: PoolOptions<Worker>

    Options for a poolifier thread pool.

    -
    \ No newline at end of file +ThreadPoolOptions | poolifier - v4.0.15

    Type alias ThreadPoolOptions

    ThreadPoolOptions: PoolOptions<Worker>

    Options for a poolifier thread pool.

    +
    \ No newline at end of file diff --git a/docs/types/WorkerChoiceStrategy.html b/docs/types/WorkerChoiceStrategy.html index 88983aaf..a50df528 100644 --- a/docs/types/WorkerChoiceStrategy.html +++ b/docs/types/WorkerChoiceStrategy.html @@ -1,2 +1,2 @@ -WorkerChoiceStrategy | poolifier - v4.0.14

    Type alias WorkerChoiceStrategy

    WorkerChoiceStrategy: keyof typeof WorkerChoiceStrategies

    Worker choice strategy.

    -
    \ No newline at end of file +WorkerChoiceStrategy | poolifier - v4.0.15

    Type alias WorkerChoiceStrategy

    WorkerChoiceStrategy: keyof typeof WorkerChoiceStrategies

    Worker choice strategy.

    +
    \ No newline at end of file diff --git a/docs/types/WorkerType.html b/docs/types/WorkerType.html index 88dafb52..e32514f8 100644 --- a/docs/types/WorkerType.html +++ b/docs/types/WorkerType.html @@ -1,2 +1,2 @@ -WorkerType | poolifier - v4.0.14

    Type alias WorkerType

    WorkerType: keyof typeof WorkerTypes

    Worker type.

    -
    \ No newline at end of file +WorkerType | poolifier - v4.0.15

    Type alias WorkerType

    WorkerType: keyof typeof WorkerTypes

    Worker type.

    +
    \ No newline at end of file diff --git a/docs/types/Writable.html b/docs/types/Writable.html index c122e312..a11f8d09 100644 --- a/docs/types/Writable.html +++ b/docs/types/Writable.html @@ -1 +1 @@ -Writable | poolifier - v4.0.14

    Type alias Writable<T>

    Writable<T>: {
        -readonly [P in keyof T]: T[P]
    }

    Type Parameters

    • T
    \ No newline at end of file +Writable | poolifier - v4.0.15

    Type alias Writable<T>

    Writable<T>: {
        -readonly [P in keyof T]: T[P]
    }

    Type Parameters

    • T
    \ No newline at end of file diff --git a/docs/variables/KillBehaviors.html b/docs/variables/KillBehaviors.html index dad876b3..14e6c22c 100644 --- a/docs/variables/KillBehaviors.html +++ b/docs/variables/KillBehaviors.html @@ -1,2 +1,2 @@ -KillBehaviors | poolifier - v4.0.14

    Variable KillBehaviorsConst

    KillBehaviors: Readonly<{
        HARD: "HARD";
        SOFT: "SOFT";
    }> = ...

    Enumeration of kill behaviors.

    -

    Type declaration

    • HARD: "HARD"
    • SOFT: "SOFT"
    \ No newline at end of file +KillBehaviors | poolifier - v4.0.15

    Variable KillBehaviorsConst

    KillBehaviors: Readonly<{
        HARD: "HARD";
        SOFT: "SOFT";
    }> = ...

    Enumeration of kill behaviors.

    +

    Type declaration

    • HARD: "HARD"
    • SOFT: "SOFT"
    \ No newline at end of file diff --git a/docs/variables/Measurements.html b/docs/variables/Measurements.html index dec60025..3ca92926 100644 --- a/docs/variables/Measurements.html +++ b/docs/variables/Measurements.html @@ -1,2 +1,2 @@ -Measurements | poolifier - v4.0.14

    Variable MeasurementsConst

    Measurements: Readonly<{
        elu: "elu";
        runTime: "runTime";
        waitTime: "waitTime";
    }> = ...

    Enumeration of measurements.

    -

    Type declaration

    • elu: "elu"
    • runTime: "runTime"
    • waitTime: "waitTime"
    \ No newline at end of file +Measurements | poolifier - v4.0.15

    Variable MeasurementsConst

    Measurements: Readonly<{
        elu: "elu";
        runTime: "runTime";
        waitTime: "waitTime";
    }> = ...

    Enumeration of measurements.

    +

    Type declaration

    • elu: "elu"
    • runTime: "runTime"
    • waitTime: "waitTime"
    \ No newline at end of file diff --git a/docs/variables/PoolEvents.html b/docs/variables/PoolEvents.html index 99c984d6..9c7b5d4f 100644 --- a/docs/variables/PoolEvents.html +++ b/docs/variables/PoolEvents.html @@ -1,2 +1,2 @@ -PoolEvents | poolifier - v4.0.14

    Variable PoolEventsConst

    PoolEvents: Readonly<{
        backPressure: "backPressure";
        busy: "busy";
        destroy: "destroy";
        empty: "empty";
        error: "error";
        full: "full";
        ready: "ready";
        taskError: "taskError";
    }> = ...

    Enumeration of pool events.

    -

    Type declaration

    • backPressure: "backPressure"
    • busy: "busy"
    • destroy: "destroy"
    • empty: "empty"
    • error: "error"
    • full: "full"
    • ready: "ready"
    • taskError: "taskError"
    \ No newline at end of file +PoolEvents | poolifier - v4.0.15

    Variable PoolEventsConst

    PoolEvents: Readonly<{
        backPressure: "backPressure";
        busy: "busy";
        destroy: "destroy";
        empty: "empty";
        error: "error";
        full: "full";
        ready: "ready";
        taskError: "taskError";
    }> = ...

    Enumeration of pool events.

    +

    Type declaration

    • backPressure: "backPressure"
    • busy: "busy"
    • destroy: "destroy"
    • empty: "empty"
    • error: "error"
    • full: "full"
    • ready: "ready"
    • taskError: "taskError"
    \ No newline at end of file diff --git a/docs/variables/PoolTypes.html b/docs/variables/PoolTypes.html index f243002f..fe3eb72c 100644 --- a/docs/variables/PoolTypes.html +++ b/docs/variables/PoolTypes.html @@ -1,2 +1,2 @@ -PoolTypes | poolifier - v4.0.14

    Variable PoolTypesConst

    PoolTypes: Readonly<{
        dynamic: "dynamic";
        fixed: "fixed";
    }> = ...

    Enumeration of pool types.

    -

    Type declaration

    • dynamic: "dynamic"
    • fixed: "fixed"
    \ No newline at end of file +PoolTypes | poolifier - v4.0.15

    Variable PoolTypesConst

    PoolTypes: Readonly<{
        dynamic: "dynamic";
        fixed: "fixed";
    }> = ...

    Enumeration of pool types.

    +

    Type declaration

    • dynamic: "dynamic"
    • fixed: "fixed"
    \ No newline at end of file diff --git a/docs/variables/WorkerChoiceStrategies.html b/docs/variables/WorkerChoiceStrategies.html index 8b61585b..10615ad0 100644 --- a/docs/variables/WorkerChoiceStrategies.html +++ b/docs/variables/WorkerChoiceStrategies.html @@ -1,2 +1,2 @@ -WorkerChoiceStrategies | poolifier - v4.0.14

    Variable WorkerChoiceStrategiesConst

    WorkerChoiceStrategies: Readonly<{
        FAIR_SHARE: "FAIR_SHARE";
        INTERLEAVED_WEIGHTED_ROUND_ROBIN: "INTERLEAVED_WEIGHTED_ROUND_ROBIN";
        LEAST_BUSY: "LEAST_BUSY";
        LEAST_ELU: "LEAST_ELU";
        LEAST_USED: "LEAST_USED";
        ROUND_ROBIN: "ROUND_ROBIN";
        WEIGHTED_ROUND_ROBIN: "WEIGHTED_ROUND_ROBIN";
    }> = ...

    Enumeration of worker choice strategies.

    -

    Type declaration

    • FAIR_SHARE: "FAIR_SHARE"
    • INTERLEAVED_WEIGHTED_ROUND_ROBIN: "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
    • LEAST_BUSY: "LEAST_BUSY"
    • LEAST_ELU: "LEAST_ELU"
    • LEAST_USED: "LEAST_USED"
    • ROUND_ROBIN: "ROUND_ROBIN"
    • WEIGHTED_ROUND_ROBIN: "WEIGHTED_ROUND_ROBIN"
    \ No newline at end of file +WorkerChoiceStrategies | poolifier - v4.0.15

    Variable WorkerChoiceStrategiesConst

    WorkerChoiceStrategies: Readonly<{
        FAIR_SHARE: "FAIR_SHARE";
        INTERLEAVED_WEIGHTED_ROUND_ROBIN: "INTERLEAVED_WEIGHTED_ROUND_ROBIN";
        LEAST_BUSY: "LEAST_BUSY";
        LEAST_ELU: "LEAST_ELU";
        LEAST_USED: "LEAST_USED";
        ROUND_ROBIN: "ROUND_ROBIN";
        WEIGHTED_ROUND_ROBIN: "WEIGHTED_ROUND_ROBIN";
    }> = ...

    Enumeration of worker choice strategies.

    +

    Type declaration

    • FAIR_SHARE: "FAIR_SHARE"
    • INTERLEAVED_WEIGHTED_ROUND_ROBIN: "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
    • LEAST_BUSY: "LEAST_BUSY"
    • LEAST_ELU: "LEAST_ELU"
    • LEAST_USED: "LEAST_USED"
    • ROUND_ROBIN: "ROUND_ROBIN"
    • WEIGHTED_ROUND_ROBIN: "WEIGHTED_ROUND_ROBIN"
    \ No newline at end of file diff --git a/docs/variables/WorkerTypes.html b/docs/variables/WorkerTypes.html index 574ec080..1d5279f9 100644 --- a/docs/variables/WorkerTypes.html +++ b/docs/variables/WorkerTypes.html @@ -1,2 +1,2 @@ -WorkerTypes | poolifier - v4.0.14

    Variable WorkerTypesConst

    WorkerTypes: Readonly<{
        cluster: "cluster";
        thread: "thread";
    }> = ...

    Enumeration of worker types.

    -

    Type declaration

    • cluster: "cluster"
    • thread: "thread"
    \ No newline at end of file +WorkerTypes | poolifier - v4.0.15

    Variable WorkerTypesConst

    WorkerTypes: Readonly<{
        cluster: "cluster";
        thread: "thread";
    }> = ...

    Enumeration of worker types.

    +

    Type declaration

    • cluster: "cluster"
    • thread: "thread"
    \ No newline at end of file -- 2.34.1