From 948524d72251b0ce7734f01afdc97af9521d5038 Mon Sep 17 00:00:00 2001 From: Documentation Bot Date: Fri, 15 Nov 2024 14:37:19 +0000 Subject: [PATCH] docs: publish documentation --- docs/classes/src.AbstractPool.html | 88 +++++++++---------- docs/classes/src.AbstractWorker.html | 50 +++++------ docs/classes/src.CircularBuffer.html | 16 ++-- docs/classes/src.ClusterWorker.html | 50 +++++------ docs/classes/src.DynamicClusterPool.html | 88 +++++++++---------- docs/classes/src.DynamicThreadPool.html | 88 +++++++++---------- docs/classes/src.FixedClusterPool.html | 88 +++++++++---------- docs/classes/src.FixedThreadPool.html | 88 +++++++++---------- docs/classes/src.PriorityQueue.html | 24 ++--- docs/classes/src.ThreadWorker.html | 50 +++++------ .../src.WorkerChoiceStrategiesContext.html | 24 ++--- docs/documents/api.html | 4 +- docs/documents/general_guidelines.html | 4 +- docs/documents/worker_choice_strategies.html | 4 +- docs/functions/src.availableParallelism.html | 4 +- docs/hierarchy.html | 2 +- docs/index.html | 4 +- ...tLoopUtilizationMeasurementStatistics.html | 6 +- docs/interfaces/src.FixedQueueNode.html | 6 +- docs/interfaces/src.IFixedQueue.html | 24 ++--- docs/interfaces/src.IPool.html | 36 ++++---- docs/interfaces/src.IWorker.html | 22 ++--- .../interfaces/src.IWorkerChoiceStrategy.html | 18 ++-- docs/interfaces/src.IWorkerNode.html | 40 ++++----- docs/interfaces/src.MeasurementOptions.html | 6 +- .../interfaces/src.MeasurementStatistics.html | 16 ++-- ...src.MeasurementStatisticsRequirements.html | 10 +-- docs/interfaces/src.MessageValue.html | 44 +++++----- docs/interfaces/src.PoolInfo.html | 20 ++--- docs/interfaces/src.PoolOptions.html | 32 +++---- .../src.PromiseResponseWrapper.html | 12 +-- docs/interfaces/src.StrategyData.html | 6 +- docs/interfaces/src.StrategyPolicy.html | 8 +- docs/interfaces/src.Task.html | 18 ++-- docs/interfaces/src.TaskFunctionObject.html | 10 +-- .../src.TaskFunctionOperationResult.html | 6 +- .../src.TaskFunctionProperties.html | 10 +-- docs/interfaces/src.TaskPerformance.html | 12 +-- docs/interfaces/src.TaskStatistics.html | 18 ++-- .../src.TaskStatisticsRequirements.html | 10 +-- docs/interfaces/src.TasksQueueOptions.html | 16 ++-- .../src.WorkerChoiceStrategyOptions.html | 14 +-- docs/interfaces/src.WorkerError.html | 14 +-- docs/interfaces/src.WorkerInfo.html | 24 ++--- .../interfaces/src.WorkerNodeEventDetail.html | 6 +- docs/interfaces/src.WorkerNodeOptions.html | 6 +- docs/interfaces/src.WorkerOptions.html | 10 +-- docs/interfaces/src.WorkerStatistics.html | 8 +- docs/interfaces/src.WorkerUsage.html | 12 +-- docs/modules/src.html | 4 +- docs/types/src.ClusterPoolOptions.html | 4 +- docs/types/src.ErrorHandler.html | 4 +- docs/types/src.EventHandler.html | 4 +- docs/types/src.ExitHandler.html | 4 +- docs/types/src.KillBehavior.html | 4 +- docs/types/src.KillHandler.html | 4 +- docs/types/src.Measurement.html | 4 +- docs/types/src.MessageHandler.html | 4 +- docs/types/src.OnlineHandler.html | 4 +- docs/types/src.PoolEvent.html | 4 +- docs/types/src.PoolType.html | 4 +- docs/types/src.TaskAsyncFunction.html | 4 +- docs/types/src.TaskFunction.html | 4 +- docs/types/src.TaskFunctions.html | 4 +- docs/types/src.TaskSyncFunction.html | 4 +- docs/types/src.ThreadPoolOptions.html | 4 +- docs/types/src.WorkerChoiceStrategy.html | 4 +- docs/types/src.WorkerType.html | 4 +- docs/types/src.Writable.html | 4 +- docs/variables/src.KillBehaviors.html | 4 +- docs/variables/src.Measurements.html | 4 +- docs/variables/src.PoolEvents.html | 4 +- docs/variables/src.PoolTypes.html | 4 +- .../variables/src.WorkerChoiceStrategies.html | 4 +- docs/variables/src.WorkerTypes.html | 4 +- 75 files changed, 640 insertions(+), 640 deletions(-) diff --git a/docs/classes/src.AbstractPool.html b/docs/classes/src.AbstractPool.html index 90255c16..44ab7153 100644 --- a/docs/classes/src.AbstractPool.html +++ b/docs/classes/src.AbstractPool.html @@ -1,8 +1,8 @@ -AbstractPool | poolifier - v4.4.4

Class AbstractPool<Worker, Data, Response>Abstract

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

+AbstractPool | poolifier - v4.4.5

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

  • filePath: string

    Path to the worker file.

  • opts: PoolOptions<Worker>

    Options for the pool.

  • OptionalmaximumNumberOfWorkers: number

    Maximum number of workers that this pool manages.

    -
  • Returns AbstractPool<Worker, Data, Response>

    Properties

    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. +

    Returns AbstractPool<Worker, 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:

      @@ -72,93 +72,93 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'backPressure': Emitted when the number of workers created in the pool has reached the maximum size expected and are back pressured (i.e. their tasks queue is full: queue size >= maximum queue size).
    • 'backPressureEnd': Emitted when the number of workers created in the pool has reached the maximum size expected and are no longer back pressured (i.e. their tasks queue is no longer 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.

    -
    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 backPressure(): boolean
    • Whether the pool is back pressured or not.

      Returns boolean

      The pool back pressure boolean status.

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

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

      -

      Returns "fixed" | "dynamic"

    Methods

    • Parameters

    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

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

      +

    Returns void

    • 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.

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

      Type Parameters

      • Message

      Parameters

      • workerNodeKey: number

        The worker node key.

      • listener: ((message: MessageValue<Message, unknown>) => 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>

    • Parameters

      • Optionaldata: Data

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

        +

      Returns Promise<void>

    • Parameters

      • Optionaldata: Data

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

      • Optionalname: string

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

      • OptionaltransferList: 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>

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

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

      Parameters

      • workerNodeKey: number

        The worker node key.

      Returns undefined | WorkerInfo

      The worker information.

      -
    • Whether the worker nodes are back pressured or not.

      Returns boolean

      Worker nodes back pressure boolean status.

      -
    • 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.

      -
    • Parameters

      • data: Iterable<Data, any, any>

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

        +
    • Parameters

      • data: Iterable<Data, any, any>

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

      • Optionalname: string

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

      • OptionaltransferList: 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[]>

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

      -
    • 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: MessageValue<Message, unknown>) => 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: MessageValue<Message, unknown>) => void)

        The message listener callback.

        -

      Returns void

    • Sends the startup 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.

      • OptionaltransferList: readonly TransferListItem[]

        The optional array of transferable objects.

        -

      Returns void

    • Parameters

      • name: string

        The name of the task function.

        +

      Returns void

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

      -

      Returns void

    • Parameters

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

      Returns void

    • Parameters

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

      Returns void

    • Conditions for dynamic worker creation.

      Returns boolean

      Whether to create a dynamic worker or not.

      -
    +

    Returns void

    diff --git a/docs/classes/src.AbstractWorker.html b/docs/classes/src.AbstractWorker.html index 90b47018..71cbfdaa 100644 --- a/docs/classes/src.AbstractWorker.html +++ b/docs/classes/src.AbstractWorker.html @@ -1,8 +1,8 @@ -AbstractWorker | poolifier - v4.4.4

    Class AbstractWorker<MainWorker, Data, Response>Abstract

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

    +AbstractWorker | poolifier - v4.4.5

    Class AbstractWorker<MainWorker, Data, Response>Abstract

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

    Type Parameters

    • MainWorker extends MessagePort | Worker

      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 @@ -31,50 +31,50 @@
  • 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 execute method 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.

    -
    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 execute method 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.

    +
    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 execute method is invoked.

    +

    Methods

    • Handles a worker error.

      +
    • Handles a worker error.

      Parameters

      • error: Error

        The error raised by the worker.

      Returns {
          error?: Error;
          message: string;
          stack?: string;
      }

      The worker error object.

      -
      • Optionalerror?: Error
      • message: string
      • Optionalstack?: string
    • Handles a kill message sent by the main worker.

      +
      • Optionalerror?: Error
      • message: string
      • Optionalstack?: string
    • 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

    +
    diff --git a/docs/classes/src.CircularBuffer.html b/docs/classes/src.CircularBuffer.html index 29372e85..672cd3a0 100644 --- a/docs/classes/src.CircularBuffer.html +++ b/docs/classes/src.CircularBuffer.html @@ -1,5 +1,5 @@ -CircularBuffer | poolifier - v4.4.4

    Class CircularBufferInternal

    Circular buffer designed for positive numbers.

    -

    Constructors

    constructor +CircularBuffer | poolifier - v4.4.5

    Class CircularBufferInternal

    Circular buffer designed for positive numbers.

    +

    Constructors

    Properties

    Methods

    empty full @@ -11,14 +11,14 @@
    defaultBufferSize
     
    -

    Properties

    size: number

    Methods

    • Checks whether the buffer is empty.

      +

    Properties

    size: number

    Methods

    • 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

    +
    diff --git a/docs/classes/src.ClusterWorker.html b/docs/classes/src.ClusterWorker.html index f6519f3d..5ee98042 100644 --- a/docs/classes/src.ClusterWorker.html +++ b/docs/classes/src.ClusterWorker.html @@ -1,4 +1,4 @@ -ClusterWorker | poolifier - v4.4.4

    Class ClusterWorker<Data, Response>

    A cluster worker used by a poolifier ClusterPool.

    +ClusterWorker | poolifier - v4.4.5

    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.

    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 execute method 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 execute method is invoked.

    +

    Accessors

    Methods

    • Handles a worker error.

      +
    • Handles a worker error.

      Parameters

      • error: Error

        The error raised by the worker.

      Returns {
          message: string;
          stack?: string;
      }

      The worker error object.

      -
      • message: string
      • Optionalstack?: string
    • 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

    +
    diff --git a/docs/classes/src.DynamicClusterPool.html b/docs/classes/src.DynamicClusterPool.html index 84663db9..6daccb6c 100644 --- a/docs/classes/src.DynamicClusterPool.html +++ b/docs/classes/src.DynamicClusterPool.html @@ -1,11 +1,11 @@ -DynamicClusterPool | poolifier - v4.4.4

    Class DynamicClusterPool<Data, Response>

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

    +DynamicClusterPool | poolifier - v4.4.5

    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.

    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? @@ -59,7 +59,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:

      @@ -75,92 +75,92 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'backPressure': Emitted when the number of workers created in the pool has reached the maximum size expected and are back pressured (i.e. their tasks queue is full: queue size >= maximum queue size).
    • 'backPressureEnd': Emitted when the number of workers created in the pool has reached the maximum size expected and are no longer back pressured (i.e. their tasks queue is no longer 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

    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

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

    Pool worker nodes.

    +

    Accessors

    • get backPressure(): boolean
    • Whether the pool is back pressured or not.

      Returns boolean

      The pool back pressure boolean status.

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

      Returns boolean

      The pool busyness boolean status.

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

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

      -

      Returns "fixed" | "dynamic"

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

      -

      Returns "cluster" | "thread"

    Methods

    • Parameters

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

      +

      Returns "cluster" | "thread"

    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

    • Parameters

      • Optionaldata: Data

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

      • Optionalname: string

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

      • OptionaltransferList: 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>

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

      -
    • Parameters

      • data: Iterable<Data, any, any>

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

      • Optionalname: string

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

      • OptionaltransferList: 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[]>

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

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

      +

    Returns void

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

      +

    Returns void

    • Parameters

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

      Returns void

    • Parameters

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

      Returns void

    +

    Returns void

    diff --git a/docs/classes/src.DynamicThreadPool.html b/docs/classes/src.DynamicThreadPool.html index cf817a02..efecf3f7 100644 --- a/docs/classes/src.DynamicThreadPool.html +++ b/docs/classes/src.DynamicThreadPool.html @@ -1,11 +1,11 @@ -DynamicThreadPool | poolifier - v4.4.4

    Class DynamicThreadPool<Data, Response>

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

    +DynamicThreadPool | poolifier - v4.4.5

    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.

    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? @@ -59,7 +59,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:

      @@ -75,93 +75,93 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'backPressure': Emitted when the number of workers created in the pool has reached the maximum size expected and are back pressured (i.e. their tasks queue is full: queue size >= maximum queue size).
    • 'backPressureEnd': Emitted when the number of workers created in the pool has reached the maximum size expected and are no longer back pressured (i.e. their tasks queue is no longer 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

    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

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

    Pool worker nodes.

    +

    Accessors

    • get backPressure(): boolean
    • Whether the pool is back pressured or not.

      Returns boolean

      The pool back pressure boolean status.

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

      Returns boolean

      The pool busyness boolean status.

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

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

      -

      Returns "fixed" | "dynamic"

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

      -

      Returns "cluster" | "thread"

    Methods

    • Parameters

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

      +

      Returns "cluster" | "thread"

    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

    • Parameters

      • Optionaldata: Data

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

      • Optionalname: string

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

      • OptionaltransferList: 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>

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

      -
    • Parameters

      • data: Iterable<Data, any, any>

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

      • Optionalname: string

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

      • OptionaltransferList: 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[]>

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

      -
    • Registers a listener callback on the 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.

      • OptionaltransferList: readonly TransferListItem[]

        The optional array of transferable objects.

        -

      Returns void

    • Parameters

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

      Returns void

    • Parameters

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

      Returns void

    +

    Returns void

    diff --git a/docs/classes/src.FixedClusterPool.html b/docs/classes/src.FixedClusterPool.html index 3710db60..25406a8a 100644 --- a/docs/classes/src.FixedClusterPool.html +++ b/docs/classes/src.FixedClusterPool.html @@ -1,9 +1,9 @@ -FixedClusterPool | poolifier - v4.4.4

    Class FixedClusterPool<Data, Response>

    A cluster pool with a fixed number of workers.

    +FixedClusterPool | poolifier - v4.4.5

    Class FixedClusterPool<Data, Response>

    A cluster pool with a fixed number of workers.

    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.

  • OptionalmaximumNumberOfWorkers: 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:

      @@ -73,92 +73,92 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'backPressure': Emitted when the number of workers created in the pool has reached the maximum size expected and are back pressured (i.e. their tasks queue is full: queue size >= maximum queue size).
    • 'backPressureEnd': Emitted when the number of workers created in the pool has reached the maximum size expected and are no longer back pressured (i.e. their tasks queue is no longer 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

    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

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

    Pool worker nodes.

    +

    Accessors

    • get backPressure(): boolean
    • Whether the pool is back pressured or not.

      Returns boolean

      The pool back pressure boolean status.

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

      Returns boolean

      The pool busyness boolean status.

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

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

      -

      Returns "fixed" | "dynamic"

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

      -

      Returns "cluster" | "thread"

    Methods

    • Parameters

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

      +

      Returns "cluster" | "thread"

    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

    • Parameters

      • Optionaldata: Data

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

      • Optionalname: string

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

      • OptionaltransferList: 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>

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

      -
    • Parameters

      • data: Iterable<Data, any, any>

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

      • Optionalname: string

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

      • OptionaltransferList: 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[]>

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

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

      +

    Returns void

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

      +

    Returns void

    • Parameters

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

      Returns void

    • Parameters

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

      Returns void

    +

    Returns void

    diff --git a/docs/classes/src.FixedThreadPool.html b/docs/classes/src.FixedThreadPool.html index 40ccc00c..92da52b9 100644 --- a/docs/classes/src.FixedThreadPool.html +++ b/docs/classes/src.FixedThreadPool.html @@ -1,9 +1,9 @@ -FixedThreadPool | poolifier - v4.4.4

    Class FixedThreadPool<Data, Response>

    A thread pool with a fixed number of threads.

    +FixedThreadPool | poolifier - v4.4.5

    Class FixedThreadPool<Data, Response>

    A thread pool with a fixed number of threads.

    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.

  • OptionalmaximumNumberOfThreads: 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:

      @@ -73,93 +73,93 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'backPressure': Emitted when the number of workers created in the pool has reached the maximum size expected and are back pressured (i.e. their tasks queue is full: queue size >= maximum queue size).
    • 'backPressureEnd': Emitted when the number of workers created in the pool has reached the maximum size expected and are no longer back pressured (i.e. their tasks queue is no longer 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

    workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<Worker, Data, Response>

    Worker choice strategies context referencing worker choice algorithms implementation.

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

    Pool worker nodes.

    +

    Accessors

    • get backPressure(): boolean
    • Whether the pool is back pressured or not.

      Returns boolean

      The pool back pressure boolean status.

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

      Returns boolean

      The pool busyness boolean status.

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

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

      -

      Returns "fixed" | "dynamic"

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

      -

      Returns "cluster" | "thread"

    Methods

    • Parameters

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

      +

      Returns "cluster" | "thread"

    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

    • Parameters

      • Optionaldata: Data

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

      • Optionalname: string

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

      • OptionaltransferList: 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>

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

      -
    • Parameters

    • Parameters

      • data: Iterable<Data, any, any>

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

      • Optionalname: string

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

      • OptionaltransferList: 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[]>

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

      -
    • Registers a listener callback on the 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.

      • OptionaltransferList: readonly TransferListItem[]

        The optional array of transferable objects.

        -

      Returns void

    • Parameters

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

      Returns void

    • Parameters

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

      Returns void

    +

    Returns void

    diff --git a/docs/classes/src.PriorityQueue.html b/docs/classes/src.PriorityQueue.html index 870c329b..015fd535 100644 --- a/docs/classes/src.PriorityQueue.html +++ b/docs/classes/src.PriorityQueue.html @@ -1,6 +1,6 @@ -PriorityQueue | poolifier - v4.4.4

    Class PriorityQueue<T>Internal

    Priority queue.

    +PriorityQueue | poolifier - v4.4.5

    Class PriorityQueue<T>Internal

    Priority queue.

    Type Parameters

    • T

      Type of priority queue data.

      -

    Constructors

    Constructors

    Properties

    Accessors

    buckets enablePriority @@ -19,24 +19,24 @@
    false
     
    -

    Properties

    maxSize: number

    The priority queue maximum size.

    -

    Accessors

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

      +

    Properties

    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.

      -
    • get size(): number
    • The priority queue size.

      +

    Returns void

    Methods

    Methods

    • Dequeue data from the priority queue.

      +
    • Dequeue data from the priority queue.

      Parameters

      • Optionalbucket: 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.

      • Optionalpriority: number

        Priority of the data. Lower values have higher priority.

      Returns number

      The new size of the priority queue.

      -
    +
    diff --git a/docs/classes/src.ThreadWorker.html b/docs/classes/src.ThreadWorker.html index 1bb7dbb6..e316f90a 100644 --- a/docs/classes/src.ThreadWorker.html +++ b/docs/classes/src.ThreadWorker.html @@ -1,4 +1,4 @@ -ThreadWorker | poolifier - v4.4.4

    Class ThreadWorker<Data, Response>

    A thread worker used by a poolifier ThreadPool.

    +ThreadWorker | poolifier - v4.4.5

    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.

    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 @@ -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 execute method 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.

    +
    statistics?: WorkerStatistics

    Performance statistics computation requirements.

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

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

    +

    Accessors

    Methods

    • Handles a worker error.

      +
    • Handles a worker error.

      Parameters

      • error: Error

        The error raised by the worker.

      Returns {
          error: Error;
          message: string;
          stack?: string;
      }

      The worker error object.

      -
      • error: Error
      • message: string
      • Optionalstack?: string
    • 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

    +
    diff --git a/docs/classes/src.WorkerChoiceStrategiesContext.html b/docs/classes/src.WorkerChoiceStrategiesContext.html index a6bd7457..3a429701 100644 --- a/docs/classes/src.WorkerChoiceStrategiesContext.html +++ b/docs/classes/src.WorkerChoiceStrategiesContext.html @@ -1,8 +1,8 @@ -WorkerChoiceStrategiesContext | poolifier - v4.4.4

    Class WorkerChoiceStrategiesContext<Worker, Data, Response>Internal

    The worker choice strategies context.

    +WorkerChoiceStrategiesContext | poolifier - v4.4.5

    Class WorkerChoiceStrategiesContext<Worker, Data, Response>Internal

    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

    Methods

    execute getPolicy @@ -19,30 +19,30 @@

    Returns WorkerChoiceStrategiesContext<Worker, Data, Response>

    [WorkerChoiceStrategies.ROUND_ROBIN]
     
    -

    Properties

    retriesCount: number

    The number of worker choice strategies execution retries.

    -

    Methods

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

      +

    Properties

    retriesCount: number

    The number of worker choice strategies execution retries.

    +

    Methods

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

      Parameters

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

        The worker choice strategy algorithm to execute.

      Returns number

      The key of the worker node.

      this.defaultWorkerChoiceStrategy
       

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

      -
    • Gets the active worker choice strategies in the context policy.

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

      Parameters

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

        The default worker choice strategy to set.

      • Optionalopts: 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<
            | "FAIR_SHARE"
            | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
            | "LEAST_BUSY"
            | "LEAST_ELU"
            | "LEAST_USED"
            | "ROUND_ROBIN"
            | "WEIGHTED_ROUND_ROBIN">

        The worker choice strategies to synchronize.

      • Optionalopts: 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

    +
    diff --git a/docs/documents/api.html b/docs/documents/api.html index 51af4164..df2a9589 100644 --- a/docs/documents/api.html +++ b/docs/documents/api.html @@ -1,4 +1,4 @@ -api | poolifier - v4.4.4

    API

    diff --git a/docs/documents/general_guidelines.html b/docs/documents/general_guidelines.html index 1a42b08a..bdf1c31b 100644 --- a/docs/documents/general_guidelines.html +++ b/docs/documents/general_guidelines.html @@ -1,4 +1,4 @@ -general-guidelines | poolifier - v4.4.4

    General guidelines

    Performance is one of the main target of these worker pool implementations, poolifier team wants to have a strong focus on this.
    +general-guidelines | poolifier - v4.4.5

    General guidelines

    Performance is one of the main target of these worker pool implementations, poolifier team wants to have a strong focus on this.
    Poolifier already has benchmarks where you can find some comparisons.

    • Internal Node.js thread pool
    • @@ -27,4 +27,4 @@ By doing so, your application will be ready to execute in parallel more tasks, b One good choice from poolifier team point of view is to profile your application using a fixed or dynamic worker pool, and analyze your application metrics when you increase/decrease the number of workers.
      For example you could keep the memory footprint low by choosing a DynamicThreadPool/DynamicClusterPool with a minimum of 5 workers, and allowing it to create new workers until a maximum of 50 workers if needed. This is the advantage of using a DynamicThreadPool/DynamicClusterPool.
      But in general, always profile your application.

      -
    +
    diff --git a/docs/documents/worker_choice_strategies.html b/docs/documents/worker_choice_strategies.html index 8530975e..d30df27c 100644 --- a/docs/documents/worker_choice_strategies.html +++ b/docs/documents/worker_choice_strategies.html @@ -1,4 +1,4 @@ -worker-choice-strategies | poolifier - v4.4.4

    Worker choice strategies

    All duration or timestamp are expressed in milliseconds.

    +worker-choice-strategies | poolifier - v4.4.5

    Worker choice strategies

    All duration or timestamp are expressed in milliseconds.

    • Strategies
        @@ -21,4 +21,4 @@ During a round, if the worker weight is superior or equal to the current round w The default worker weights is the same for each and computed given the CPU cores speed and theirs numbers. So the default 'rounds' consists of a unique worker weight.

        Worker choice strategies enable only the statistics that are needed to choose the next worker to avoid unnecessary overhead.

        Strategies using the simple moving average task execution time for each worker can use the simple moving median instead. Simple moving median is more robust to outliers and can be used to avoid assigning tasks to workers that are currently overloaded.

        -
    +
    diff --git a/docs/functions/src.availableParallelism.html b/docs/functions/src.availableParallelism.html index 3ff4cd3d..2e8dfd60 100644 --- a/docs/functions/src.availableParallelism.html +++ b/docs/functions/src.availableParallelism.html @@ -1,4 +1,4 @@ -availableParallelism | poolifier - v4.4.4

    Function availableParallelism

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

    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.

      -
    +
    diff --git a/docs/hierarchy.html b/docs/hierarchy.html index d2bdab4b..803d9b0a 100644 --- a/docs/hierarchy.html +++ b/docs/hierarchy.html @@ -1 +1 @@ -poolifier - v4.4.4
    +poolifier - v4.4.5
    diff --git a/docs/index.html b/docs/index.html index 28af323b..da0dfa68 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,5 +1,5 @@ -poolifier - v4.4.4

    poolifier - v4.4.4

    Index

    Documents

    api +poolifier - v4.4.5

    poolifier - v4.4.5

    Index

    Documents

    Modules

    src -
    +
    diff --git a/docs/interfaces/src.EventLoopUtilizationMeasurementStatistics.html b/docs/interfaces/src.EventLoopUtilizationMeasurementStatistics.html index 0195679e..a9389fe4 100644 --- a/docs/interfaces/src.EventLoopUtilizationMeasurementStatistics.html +++ b/docs/interfaces/src.EventLoopUtilizationMeasurementStatistics.html @@ -1,5 +1,5 @@ -EventLoopUtilizationMeasurementStatistics | poolifier - v4.4.4

    Interface EventLoopUtilizationMeasurementStatisticsInternal

    Event loop utilization measurement statistics.

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

    Properties

    active +EventLoopUtilizationMeasurementStatistics | poolifier - v4.4.5

    Interface EventLoopUtilizationMeasurementStatisticsInternal

    Event loop utilization measurement statistics.

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

    Properties

    utilization?: number
    +

    Properties

    utilization?: number
    diff --git a/docs/interfaces/src.FixedQueueNode.html b/docs/interfaces/src.FixedQueueNode.html index 8dda11a0..b492adf6 100644 --- a/docs/interfaces/src.FixedQueueNode.html +++ b/docs/interfaces/src.FixedQueueNode.html @@ -1,5 +1,5 @@ -FixedQueueNode | poolifier - v4.4.4

    Interface FixedQueueNode<T>Internal

    Fixed queue node.

    +FixedQueueNode | poolifier - v4.4.5

    Interface FixedQueueNode<T>Internal

    Fixed queue node.

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

    Type Parameters

    • T

      Type of fixed queue node data.

      -

    Properties

    Properties

    Properties

    data: T
    priority: number
    +

    Properties

    data: T
    priority: number
    diff --git a/docs/interfaces/src.IFixedQueue.html b/docs/interfaces/src.IFixedQueue.html index 00b7af43..a71ff397 100644 --- a/docs/interfaces/src.IFixedQueue.html +++ b/docs/interfaces/src.IFixedQueue.html @@ -1,6 +1,6 @@ -IFixedQueue | poolifier - v4.4.4

    Interface IFixedQueue<T>Internal

    Fixed queue.

    +IFixedQueue | poolifier - v4.4.5

    Interface IFixedQueue<T>Internal

    Fixed queue.

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

    Type Parameters

    • T

      Type of fixed queue data.

      -

    Properties

    Properties

    [iterator] capacity clear dequeue @@ -13,22 +13,22 @@

    Properties

    [iterator]: (() => Iterator<T, any, any>)

    Returns an iterator for the fixed queue.

    Type declaration

      • (): Iterator<T, any, any>
      • Returns Iterator<T, any, any>

        An iterator for the fixed queue.

    capacity: number

    The fixed queue capacity.

    -
    clear: (() => void)

    Clears the fixed queue.

    -
    dequeue: (() => undefined | T)

    Dequeue data from the fixed queue.

    +
    capacity: number

    The fixed queue capacity.

    +
    clear: (() => void)

    Clears the fixed queue.

    +
    dequeue: (() => undefined | T)

    Dequeue data from the fixed queue.

    Type declaration

      • (): undefined | T
      • Returns undefined | T

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

        -
    empty: (() => boolean)

    Checks if the fixed queue is empty.

    +
    empty: (() => boolean)

    Checks if the fixed queue is empty.

    Type declaration

      • (): boolean
      • Returns boolean

        true if the fixed queue is empty, false otherwise.

        -
    enqueue: ((data: T, priority?: number) => number)

    Enqueue data into the fixed queue.

    +
    enqueue: ((data: T, priority?: number) => number)

    Enqueue data into the fixed queue.

    Type declaration

      • (data, priority?): number
      • Parameters

        • data: T

          Data to enqueue.

        • Optionalpriority: number

          Priority of the data. Lower values have higher priority.

        Returns number

        The new size of the fixed queue.

    If the fixed queue is full.

    -
    full: (() => boolean)

    Checks if the fixed queue is full.

    +
    full: (() => boolean)

    Checks if the fixed queue is full.

    Type declaration

      • (): boolean
      • Returns boolean

        true if the fixed queue is full, false otherwise.

        -
    get: ((index: number) => undefined | T)

    Gets data from the fixed queue.

    +
    get: ((index: number) => undefined | T)

    Gets data from the fixed queue.

    Type declaration

      • (index): undefined | T
      • Parameters

        • index: number

          The index of the data to get.

        Returns undefined | T

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

        -
    nodeArray: FixedQueueNode<T>[]

    The fixed queue node array.

    -
    size: number

    The fixed queue size.

    -
    +
    nodeArray: FixedQueueNode<T>[]

    The fixed queue node array.

    +
    size: number

    The fixed queue size.

    +
    diff --git a/docs/interfaces/src.IPool.html b/docs/interfaces/src.IPool.html index 139a45f0..81a5d5c4 100644 --- a/docs/interfaces/src.IPool.html +++ b/docs/interfaces/src.IPool.html @@ -1,8 +1,8 @@ -IPool | poolifier - v4.4.4

    Interface IPool<Worker, Data, Response>

    Contract definition for a poolifier pool.

    +IPool | poolifier - v4.4.5

    Interface IPool<Worker, Data, Response>

    Contract definition for a poolifier pool.

    interface IPool<Worker, Data, Response> {
        addTaskFunction: ((name: string, fn: TaskFunction<Data, Response> | TaskFunctionObject<Data, Response>) => Promise<boolean>);
        destroy: (() => Promise<void>);
        emitter?: EventEmitterAsyncResource;
        enableTasksQueue: ((enable: boolean, tasksQueueOptions?: TasksQueueOptions) => void);
        execute: ((data?: Data, name?: string, transferList?: readonly TransferListItem[]) => Promise<Response>);
        hasTaskFunction: ((name: string) => boolean);
        info: PoolInfo;
        listTaskFunctionsProperties: (() => TaskFunctionProperties[]);
        mapExecute: ((data: Iterable<Data, any, any>, name?: string, transferList?: readonly TransferListItem[]) => Promise<Response[]>);
        removeTaskFunction: ((name: string) => Promise<boolean>);
        setDefaultTaskFunction: ((name: string) => Promise<boolean>);
        setTasksQueueOptions: ((tasksQueueOptions: TasksQueueOptions) => void);
        setWorkerChoiceStrategy: ((workerChoiceStrategy:
            | "FAIR_SHARE"
            | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
            | "LEAST_BUSY"
            | "LEAST_ELU"
            | "LEAST_USED"
            | "ROUND_ROBIN"
            | "WEIGHTED_ROUND_ROBIN", workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions) => void);
        setWorkerChoiceStrategyOptions: ((workerChoiceStrategyOptions: 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>

    true if the task function was added, false otherwise.

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

    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.

    -
    emitter?: EventEmitterAsyncResource

    Pool event emitter integrated with async resource. +

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

    Terminates all workers in this pool.

    +
    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:

      @@ -42,39 +42,39 @@ The async tracking tooling identifier is poolifier:<PoolType>-<Wo
    • 'backPressure': Emitted when the number of workers created in the pool has reached the maximum size expected and are back pressured (i.e. their tasks queue is full: queue size >= maximum queue size).
    • 'backPressureEnd': Emitted when the number of workers created in the pool has reached the maximum size expected and are no longer back pressured (i.e. their tasks queue is no longer full: queue size < maximum queue size).
    -
    enableTasksQueue: ((enable: boolean, tasksQueueOptions?: TasksQueueOptions) => void)

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

    +
    enableTasksQueue: ((enable: boolean, tasksQueueOptions?: 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.

        • OptionaltasksQueueOptions: TasksQueueOptions

          The worker node tasks queue options.

          -

        Returns void

    execute: ((data?: Data, name?: string, transferList?: readonly TransferListItem[]) => Promise<Response>)

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

    +

    Returns void

    execute: ((data?: Data, name?: string, transferList?: readonly TransferListItem[]) => Promise<Response>)

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

    Type declaration

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

        • Optionaldata: Data

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

        • Optionalname: string

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

        • OptionaltransferList: 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>

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

        -
    hasTaskFunction: ((name: string) => boolean)

    Whether the specified task function exists in this pool.

    +
    hasTaskFunction: ((name: string) => 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

        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

    mapExecute: ((data: Iterable<Data, any, any>, name?: string, transferList?: readonly TransferListItem[]) => Promise<Response[]>)

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

    +
    mapExecute: ((data: Iterable<Data, any, any>, name?: string, transferList?: readonly TransferListItem[]) => 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, any, any>

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

        • Optionalname: string

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

        • OptionaltransferList: 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[]>

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

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

    Removes a task function from this pool.

    +
    removeTaskFunction: ((name: string) => 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>

        true if the task function was removed, false otherwise.

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

    Sets the default task function in this pool.

    +
    setDefaultTaskFunction: ((name: string) => 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>

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

        -
    setTasksQueueOptions: ((tasksQueueOptions: TasksQueueOptions) => void)

    Sets the worker node tasks queue options in this pool.

    +
    setTasksQueueOptions: ((tasksQueueOptions: TasksQueueOptions) => void)

    Sets the worker node tasks queue options in this pool.

    Type declaration

      • (tasksQueueOptions): void
      • Parameters

        Returns void

    setWorkerChoiceStrategy: ((workerChoiceStrategy:
        | "FAIR_SHARE"
        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "LEAST_USED"
        | "ROUND_ROBIN"
        | "WEIGHTED_ROUND_ROBIN", workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions) => void)

    Sets the default worker choice strategy in this pool.

    +

    Returns void

    setWorkerChoiceStrategy: ((workerChoiceStrategy:
        | "FAIR_SHARE"
        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "LEAST_USED"
        | "ROUND_ROBIN"
        | "WEIGHTED_ROUND_ROBIN", workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions) => void)

    Sets the default worker choice strategy in this pool.

    Type declaration

      • (workerChoiceStrategy, workerChoiceStrategyOptions?): void
      • Parameters

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

          The default worker choice strategy.

        • OptionalworkerChoiceStrategyOptions: WorkerChoiceStrategyOptions

          The worker choice strategy options.

          -

        Returns void

    setWorkerChoiceStrategyOptions: ((workerChoiceStrategyOptions: WorkerChoiceStrategyOptions) => boolean)

    Sets the worker choice strategy options in this pool.

    +

    Returns void

    setWorkerChoiceStrategyOptions: ((workerChoiceStrategyOptions: WorkerChoiceStrategyOptions) => boolean)

    Sets the worker choice strategy options in this pool.

    Type declaration

      • (workerChoiceStrategyOptions): boolean
      • Parameters

        Returns boolean

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

        -
    start: (() => void)

    Starts the minimum number of workers in this pool.

    -
    workerNodes: IWorkerNode<Worker, Data>[]

    Pool worker nodes.

    -
    +
    start: (() => void)

    Starts the minimum number of workers in this pool.

    +
    workerNodes: IWorkerNode<Worker, Data>[]

    Pool worker nodes.

    +
    diff --git a/docs/interfaces/src.IWorker.html b/docs/interfaces/src.IWorker.html index 0aebd542..c1c0ccce 100644 --- a/docs/interfaces/src.IWorker.html +++ b/docs/interfaces/src.IWorker.html @@ -1,5 +1,5 @@ -IWorker | poolifier - v4.4.4

    Interface IWorker

    Worker interface.

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

    Hierarchy

    • EventEmitter
      • IWorker

    Properties

    disconnect? +IWorker | poolifier - v4.4.5

    Interface IWorker

    Worker interface.

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

    Hierarchy

    • EventEmitter
      • IWorker

    Properties

    Properties

    disconnect?: (() => void)

    Cluster worker disconnect.

    -
    id?: number

    Cluster worker id.

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

    Cluster worker kill.

    -
    on: ((event: string, handler: EventHandler<IWorker>) => this)

    Registers an event handler.

    +
    id?: number

    Cluster worker id.

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

    Cluster worker kill.

    +
    on: ((event: string, handler: EventHandler<IWorker>) => this)

    Registers an event handler.

    Type declaration

      • (event, handler): this
      • Parameters

        Returns this

    once: ((event: string, handler: EventHandler<IWorker>) => this)

    Registers once an event handler.

    +

    Returns this

    once: ((event: string, handler: EventHandler<IWorker>) => 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.

    -
    threadId?: number

    Worker thread worker id.

    -
    unref?: (() => void)

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

    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.

    v10.5.0

    -

    Methods

    • Type Parameters

      • K

      Parameters

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

      Returns void

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

      +

    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: any[]) => void)
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      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 to each.

      @@ -132,4 +132,4 @@ memory leaks. The emitter.setMaxListeners() method allows the limit 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

      v0.3.5

      -
    +
    diff --git a/docs/interfaces/src.IWorkerChoiceStrategy.html b/docs/interfaces/src.IWorkerChoiceStrategy.html index bcd43359..16c7144b 100644 --- a/docs/interfaces/src.IWorkerChoiceStrategy.html +++ b/docs/interfaces/src.IWorkerChoiceStrategy.html @@ -1,5 +1,5 @@ -IWorkerChoiceStrategy | poolifier - v4.4.4

    Interface IWorkerChoiceStrategyInternal

    Worker choice strategy interface.

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

    Properties

    choose +IWorkerChoiceStrategy | poolifier - v4.4.5

    Interface IWorkerChoiceStrategyInternal

    Worker choice strategy interface.

    +
    interface IWorkerChoiceStrategy {
        choose: (() => undefined | number);
        remove: ((workerNodeKey: number) => boolean);
        reset: (() => boolean);
        setOptions: ((opts: undefined | WorkerChoiceStrategyOptions) => void);
        strategyPolicy: StrategyPolicy;
        taskStatisticsRequirements: TaskStatisticsRequirements;
        update: ((workerNodeKey: number) => 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

        The worker node key or undefined.

        -
    remove: ((workerNodeKey: number) => boolean)

    Removes the worker node key from strategy internals.

    +
    remove: ((workerNodeKey: number) => boolean)

    Removes the worker node key from strategy internals.

    Type declaration

      • (workerNodeKey): boolean
      • Parameters

        • workerNodeKey: number

          The worker node key.

        Returns boolean

        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

        true if the reset is successful, false otherwise.

        -
    setOptions: ((opts: undefined | WorkerChoiceStrategyOptions) => void)

    Sets the worker choice strategy options.

    +
    setOptions: ((opts: undefined | WorkerChoiceStrategyOptions) => void)

    Sets the worker choice strategy options.

    Type declaration

    strategyPolicy: StrategyPolicy

    Strategy policy.

    -
    taskStatisticsRequirements: TaskStatisticsRequirements

    Tasks statistics requirements.

    -
    update: ((workerNodeKey: number) => boolean)

    Updates the worker node key strategy internals. +

    Returns void

    strategyPolicy: StrategyPolicy

    Strategy policy.

    +
    taskStatisticsRequirements: TaskStatisticsRequirements

    Tasks statistics requirements.

    +
    update: ((workerNodeKey: number) => 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

        true if the update is successful, false otherwise.

        -
    +
    diff --git a/docs/interfaces/src.IWorkerNode.html b/docs/interfaces/src.IWorkerNode.html index 80c9374b..c5cb17f6 100644 --- a/docs/interfaces/src.IWorkerNode.html +++ b/docs/interfaces/src.IWorkerNode.html @@ -1,7 +1,7 @@ -IWorkerNode | poolifier - v4.4.4

    Interface IWorkerNode<Worker, Data>Internal

    Worker node interface.

    +IWorkerNode | poolifier - v4.4.5

    Interface IWorkerNode<Worker, Data>Internal

    Worker node interface.

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

    -
    deleteTaskFunctionWorkerUsage: ((name: string) => boolean)

    Deletes task function worker usage statistics.

    +
    deleteTaskFunctionWorkerUsage: ((name: string) => boolean)

    Deletes task function worker usage statistics.

    Type declaration

      • (name): boolean
      • Parameters

        • name: string

          The task function name.

        Returns boolean

        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

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

    Dequeue task.

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

    Dequeue task.

    Type declaration

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

        • Optionalbucket: number

          The prioritized bucket to dequeue from.

        Returns undefined | Task<Data>

        The dequeued task.

    0
     
    -
    enqueueTask: ((task: Task<Data>) => number)

    Enqueue task.

    +
    enqueueTask: ((task: Task<Data>) => number)

    Enqueue task.

    Type declaration

      • (task): number
      • Parameters

        Returns number

        The tasks queue size.

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

    Gets task function worker usage statistics.

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

    Gets task function worker usage statistics.

    Type declaration

      • (name): undefined | WorkerUsage
      • Parameters

        • name: string

          The task function name.

        Returns undefined | WorkerUsage

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

        -

    Worker info.

    -
    messageChannel?: MessageChannel

    Message channel (worker thread only).

    -
    registerOnceWorkerEventHandler: ((event: string, handler: EventHandler<Worker>) => void)

    Registers once a worker event handler.

    +

    Worker info.

    +
    messageChannel?: MessageChannel

    Message channel (worker thread only).

    +
    registerOnceWorkerEventHandler: ((event: string, handler: EventHandler<Worker>) => void)

    Registers once a worker event handler.

    Type declaration

      • (event, handler): void
      • Parameters

        Returns void

    registerWorkerEventHandler: ((event: string, handler: EventHandler<Worker>) => void)

    Registers a worker event handler.

    +

    Returns void

    registerWorkerEventHandler: ((event: string, handler: EventHandler<Worker>) => void)

    Registers a worker event handler.

    Type declaration

      • (event, handler): void
      • Parameters

        Returns void

    setTasksQueuePriority: ((enablePriority: boolean) => void)

    Sets tasks queue priority.

    +

    Returns void

    setTasksQueuePriority: ((enablePriority: boolean) => 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

        The tasks queue size.

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

    Terminates the worker node.

    -

    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).

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

    Terminates the worker node.

    +

    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: any[]) => void)
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      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 to each.

      @@ -197,4 +197,4 @@ memory leaks. The emitter.setMaxListeners() method allows the limit 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

      v0.3.5

      -
    +
    diff --git a/docs/interfaces/src.MeasurementOptions.html b/docs/interfaces/src.MeasurementOptions.html index 2cb9155e..760e27d5 100644 --- a/docs/interfaces/src.MeasurementOptions.html +++ b/docs/interfaces/src.MeasurementOptions.html @@ -1,4 +1,4 @@ -MeasurementOptions | poolifier - v4.4.4

    Interface MeasurementOptions

    Measurement options.

    -
    interface MeasurementOptions {
        median: boolean;
    }

    Properties

    median +MeasurementOptions | poolifier - v4.4.5

    Interface MeasurementOptions

    Measurement options.

    +
    interface MeasurementOptions {
        median: boolean;
    }

    Properties

    Properties

    median: boolean

    Set measurement median.

    -
    +
    diff --git a/docs/interfaces/src.MeasurementStatistics.html b/docs/interfaces/src.MeasurementStatistics.html index 6498c151..4e760afd 100644 --- a/docs/interfaces/src.MeasurementStatistics.html +++ b/docs/interfaces/src.MeasurementStatistics.html @@ -1,14 +1,14 @@ -MeasurementStatistics | poolifier - v4.4.4

    Interface MeasurementStatisticsInternal

    Measurement statistics.

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

    Properties

    aggregate? +MeasurementStatistics | poolifier - v4.4.5

    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.

    -
    +
    average?: number

    Measurement average.

    +

    Measurement history.

    +
    maximum?: number

    Measurement maximum.

    +
    median?: number

    Measurement median.

    +
    minimum?: number

    Measurement minimum.

    +
    diff --git a/docs/interfaces/src.MeasurementStatisticsRequirements.html b/docs/interfaces/src.MeasurementStatisticsRequirements.html index 025e1abc..2db52f1e 100644 --- a/docs/interfaces/src.MeasurementStatisticsRequirements.html +++ b/docs/interfaces/src.MeasurementStatisticsRequirements.html @@ -1,8 +1,8 @@ -MeasurementStatisticsRequirements | poolifier - v4.4.4

    Interface MeasurementStatisticsRequirementsInternal

    Measurement statistics requirements.

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

    Properties

    aggregate +MeasurementStatisticsRequirements | poolifier - v4.4.5

    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.

    -
    +
    average: boolean

    Requires measurement average.

    +
    median: boolean

    Requires measurement median.

    +
    diff --git a/docs/interfaces/src.MessageValue.html b/docs/interfaces/src.MessageValue.html index 3036cb43..be804416 100644 --- a/docs/interfaces/src.MessageValue.html +++ b/docs/interfaces/src.MessageValue.html @@ -1,7 +1,7 @@ -MessageValue | poolifier - v4.4.4

    Interface MessageValue<Data, ErrorData>Internal

    Message object that is passed between main worker and worker.

    +MessageValue | poolifier - v4.4.5

    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"
            | "HARD"
            | "SOFT"
            | "failure";
        name?: string;
        port?: MessagePort;
        priority?: number;
        ready?: boolean;
        statistics?: WorkerStatistics;
        strategy?:
            | "FAIR_SHARE"
            | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
            | "LEAST_BUSY"
            | "LEAST_ELU"
            | "LEAST_USED"
            | "ROUND_ROBIN"
            | "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"
        | "HARD"
        | "SOFT"
        | "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"
        | "HARD"
        | "SOFT"
        | "failure"

    Kill code.

    +
    name?: string

    Task name.

    +
    port?: MessagePort

    Message port.

    +
    priority?: number

    Task priority. Lower values have higher priority.

    0
     
    -
    ready?: boolean

    Whether the worker is ready or not.

    -
    statistics?: WorkerStatistics

    Whether the worker computes the given statistics or not.

    -
    strategy?:
        | "FAIR_SHARE"
        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "LEAST_USED"
        | "ROUND_ROBIN"
        | "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?:
        | "FAIR_SHARE"
        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "LEAST_USED"
        | "ROUND_ROBIN"
        | "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.

    -
    +
    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.

    +
    diff --git a/docs/interfaces/src.PoolInfo.html b/docs/interfaces/src.PoolInfo.html index bae3fd26..e7db6a49 100644 --- a/docs/interfaces/src.PoolInfo.html +++ b/docs/interfaces/src.PoolInfo.html @@ -1,5 +1,5 @@ -PoolInfo | poolifier - v4.4.4

    Interface PoolInfo

    Pool information.

    -
    interface PoolInfo {
        backPressure?: boolean;
        backPressureWorkerNodes?: number;
        busyWorkerNodes: number;
        defaultStrategy:
            | "FAIR_SHARE"
            | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
            | "LEAST_BUSY"
            | "LEAST_ELU"
            | "LEAST_USED"
            | "ROUND_ROBIN"
            | "WEIGHTED_ROUND_ROBIN";
        dynamicWorkerNodes?: number;
        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: "cluster" | "thread";
        workerNodes: number;
    }

    Properties

    backPressure? +PoolInfo | poolifier - v4.4.5

    Interface PoolInfo

    Pool information.

    +
    interface PoolInfo {
        backPressure?: boolean;
        backPressureWorkerNodes?: number;
        busyWorkerNodes: number;
        defaultStrategy:
            | "FAIR_SHARE"
            | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
            | "LEAST_BUSY"
            | "LEAST_ELU"
            | "LEAST_USED"
            | "ROUND_ROBIN"
            | "WEIGHTED_ROUND_ROBIN";
        dynamicWorkerNodes?: number;
        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: "cluster" | "thread";
        workerNodes: number;
    }

    Properties

    backPressure?: boolean
    backPressureWorkerNodes?: number

    Pool tasks back pressure worker nodes.

    -
    busyWorkerNodes: number

    Pool busy worker nodes.

    -
    defaultStrategy:
        | "FAIR_SHARE"
        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "LEAST_USED"
        | "ROUND_ROBIN"
        | "WEIGHTED_ROUND_ROBIN"
    dynamicWorkerNodes?: number

    Pool dynamic worker nodes.

    -
    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

    Pool idle worker nodes.

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

    Pool tasks 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;
    }
    worker: "cluster" | "thread"
    workerNodes: number

    Pool total worker nodes.

    -
    +

    Properties

    backPressure?: boolean
    backPressureWorkerNodes?: number

    Pool tasks back pressure worker nodes.

    +
    busyWorkerNodes: number

    Pool busy worker nodes.

    +
    defaultStrategy:
        | "FAIR_SHARE"
        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "LEAST_USED"
        | "ROUND_ROBIN"
        | "WEIGHTED_ROUND_ROBIN"
    dynamicWorkerNodes?: number

    Pool dynamic worker nodes.

    +
    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

    Pool idle worker nodes.

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

    Pool tasks 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;
    }
    worker: "cluster" | "thread"
    workerNodes: number

    Pool total worker nodes.

    +
    diff --git a/docs/interfaces/src.PoolOptions.html b/docs/interfaces/src.PoolOptions.html index 11b2a390..6b31579c 100644 --- a/docs/interfaces/src.PoolOptions.html +++ b/docs/interfaces/src.PoolOptions.html @@ -1,6 +1,6 @@ -PoolOptions | poolifier - v4.4.4

    Interface PoolOptions<Worker>

    Options for a poolifier pool.

    +PoolOptions | poolifier - v4.4.5

    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?:
            | "FAIR_SHARE"
            | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
            | "LEAST_BUSY"
            | "LEAST_ELU"
            | "LEAST_USED"
            | "ROUND_ROBIN"
            | "WEIGHTED_ROUND_ROBIN";
        workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions;
        workerOptions?: WorkerOptions;
    }

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -

    Properties

    Properties

    true
     
    -
    enableTasksQueue?: boolean

    Pool worker node tasks queue.

    +
    enableTasksQueue?: boolean

    Pool worker node tasks queue.

    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.

    () => {}

    -
    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.

    () => {}

    -
    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.

    () => {}

    -
    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.

    () => {}

    -
    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.

    true
     
    -
    tasksQueueOptions?: TasksQueueOptions

    Pool worker node tasks queue options.

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

    The default worker choice strategy to use in this pool.

    +
    tasksQueueOptions?: TasksQueueOptions

    Pool worker node tasks queue options.

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

    The default worker choice strategy to use in this pool.

    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.

    +
    diff --git a/docs/interfaces/src.PromiseResponseWrapper.html b/docs/interfaces/src.PromiseResponseWrapper.html index 5ab908f1..0a14d86a 100644 --- a/docs/interfaces/src.PromiseResponseWrapper.html +++ b/docs/interfaces/src.PromiseResponseWrapper.html @@ -1,11 +1,11 @@ -PromiseResponseWrapper | poolifier - v4.4.4

    Interface PromiseResponseWrapper<Response>Internal

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

    +PromiseResponseWrapper | poolifier - v4.4.5

    Interface PromiseResponseWrapper<Response>Internal

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

    interface PromiseResponseWrapper<Response> {
        asyncResource?: AsyncResource;
        reject: ((reason?: unknown) => void);
        resolve: ((value: Response | PromiseLike<Response>) => 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?: unknown) => void)

    Reject callback to reject the promise.

    -
    resolve: ((value: Response | PromiseLike<Response>) => void)

    Resolve callback to fulfill the promise.

    -
    workerNodeKey: number

    The worker node key executing the task.

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

    Reject callback to reject the promise.

    +
    resolve: ((value: Response | PromiseLike<Response>) => void)

    Resolve callback to fulfill the promise.

    +
    workerNodeKey: number

    The worker node key executing the task.

    +
    diff --git a/docs/interfaces/src.StrategyData.html b/docs/interfaces/src.StrategyData.html index 423f06a5..faf49bd8 100644 --- a/docs/interfaces/src.StrategyData.html +++ b/docs/interfaces/src.StrategyData.html @@ -1,3 +1,3 @@ -StrategyData | poolifier - v4.4.4

    Interface StrategyDataInternal

    Worker choice strategy data.

    -
    interface StrategyData {
        virtualTaskEndTimestamp?: number;
    }

    Properties

    virtualTaskEndTimestamp?: number
    +StrategyData | poolifier - v4.4.5

    Interface StrategyDataInternal

    Worker choice strategy data.

    +
    interface StrategyData {
        virtualTaskEndTimestamp?: number;
    }

    Properties

    virtualTaskEndTimestamp?: number
    diff --git a/docs/interfaces/src.StrategyPolicy.html b/docs/interfaces/src.StrategyPolicy.html index 81cf4168..3b968046 100644 --- a/docs/interfaces/src.StrategyPolicy.html +++ b/docs/interfaces/src.StrategyPolicy.html @@ -1,6 +1,6 @@ -StrategyPolicy | poolifier - v4.4.4

    Interface StrategyPolicyInternal

    Strategy policy.

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

    Properties

    dynamicWorkerReady +StrategyPolicy | poolifier - v4.4.5

    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.

    -
    +
    dynamicWorkerUsage: boolean

    Expects tasks execution on the newly created dynamic worker.

    +
    diff --git a/docs/interfaces/src.Task.html b/docs/interfaces/src.Task.html index e45e1343..4d713a9e 100644 --- a/docs/interfaces/src.Task.html +++ b/docs/interfaces/src.Task.html @@ -1,6 +1,6 @@ -Task | poolifier - v4.4.4

    Interface Task<Data>Internal

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

    +Task | poolifier - v4.4.5

    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?:
            | "FAIR_SHARE"
            | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
            | "LEAST_BUSY"
            | "LEAST_ELU"
            | "LEAST_USED"
            | "ROUND_ROBIN"
            | "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.

    0
     
    -
    strategy?:
        | "FAIR_SHARE"
        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "LEAST_USED"
        | "ROUND_ROBIN"
        | "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.

    -
    +
    strategy?:
        | "FAIR_SHARE"
        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "LEAST_USED"
        | "ROUND_ROBIN"
        | "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.

    +
    diff --git a/docs/interfaces/src.TaskFunctionObject.html b/docs/interfaces/src.TaskFunctionObject.html index c38e3bb8..f5716bfe 100644 --- a/docs/interfaces/src.TaskFunctionObject.html +++ b/docs/interfaces/src.TaskFunctionObject.html @@ -1,10 +1,10 @@ -TaskFunctionObject | poolifier - v4.4.4

    Interface TaskFunctionObject<Data, Response>

    Task function object.

    +TaskFunctionObject | poolifier - v4.4.5

    Interface TaskFunctionObject<Data, Response>

    Task function object.

    interface TaskFunctionObject<Data, Response> {
        priority?: number;
        strategy?:
            | "FAIR_SHARE"
            | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
            | "LEAST_BUSY"
            | "LEAST_ELU"
            | "LEAST_USED"
            | "ROUND_ROBIN"
            | "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?:
        | "FAIR_SHARE"
        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "LEAST_USED"
        | "ROUND_ROBIN"
        | "WEIGHTED_ROUND_ROBIN"

    Task function worker choice strategy.

    -
    taskFunction: TaskFunction<Data, Response>

    Task function.

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

    Task function worker choice strategy.

    +
    taskFunction: TaskFunction<Data, Response>

    Task function.

    +
    diff --git a/docs/interfaces/src.TaskFunctionOperationResult.html b/docs/interfaces/src.TaskFunctionOperationResult.html index 3ce38aee..a8cf6668 100644 --- a/docs/interfaces/src.TaskFunctionOperationResult.html +++ b/docs/interfaces/src.TaskFunctionOperationResult.html @@ -1,4 +1,4 @@ -TaskFunctionOperationResult | poolifier - v4.4.4

    Interface TaskFunctionOperationResult

    Task function operation result.

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

    Properties

    error? +TaskFunctionOperationResult | poolifier - v4.4.5

    Interface TaskFunctionOperationResult

    Task function operation result.

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

    Properties

    Properties

    error?: Error
    status: boolean
    +

    Properties

    error?: Error
    status: boolean
    diff --git a/docs/interfaces/src.TaskFunctionProperties.html b/docs/interfaces/src.TaskFunctionProperties.html index 7425fc96..909eb7f9 100644 --- a/docs/interfaces/src.TaskFunctionProperties.html +++ b/docs/interfaces/src.TaskFunctionProperties.html @@ -1,8 +1,8 @@ -TaskFunctionProperties | poolifier - v4.4.4

    Interface TaskFunctionProperties

    Task function properties.

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

    Properties

    name +TaskFunctionProperties | poolifier - v4.4.5

    Interface TaskFunctionProperties

    Task function properties.

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

    Properties

    name: string

    Task function name.

    -
    priority?: number

    Task function priority. Lower values have higher priority.

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

    Task function worker choice strategy.

    -
    +
    priority?: number

    Task function priority. Lower values have higher priority.

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

    Task function worker choice strategy.

    +
    diff --git a/docs/interfaces/src.TaskPerformance.html b/docs/interfaces/src.TaskPerformance.html index 018516e0..0463bbc6 100644 --- a/docs/interfaces/src.TaskPerformance.html +++ b/docs/interfaces/src.TaskPerformance.html @@ -1,10 +1,10 @@ -TaskPerformance | poolifier - v4.4.4

    Interface TaskPerformanceInternal

    Task performance.

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

    Properties

    elu? +TaskPerformance | poolifier - v4.4.5

    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.

    -
    +
    name: string

    Task name.

    +
    runTime?: number

    Task runtime.

    +
    timestamp: number

    Task performance timestamp.

    +
    diff --git a/docs/interfaces/src.TaskStatistics.html b/docs/interfaces/src.TaskStatistics.html index 457293db..2588353d 100644 --- a/docs/interfaces/src.TaskStatistics.html +++ b/docs/interfaces/src.TaskStatistics.html @@ -1,5 +1,5 @@ -TaskStatistics | poolifier - v4.4.4

    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.4.5

    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.

    -
    +
    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.

    +
    diff --git a/docs/interfaces/src.TaskStatisticsRequirements.html b/docs/interfaces/src.TaskStatisticsRequirements.html index fb61cd50..e5d3fd03 100644 --- a/docs/interfaces/src.TaskStatisticsRequirements.html +++ b/docs/interfaces/src.TaskStatisticsRequirements.html @@ -1,8 +1,8 @@ -TaskStatisticsRequirements | poolifier - v4.4.4

    Interface TaskStatisticsRequirementsInternal

    Pool worker node worker usage statistics requirements.

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

    Properties

    elu +TaskStatisticsRequirements | poolifier - v4.4.5

    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.

    -
    +

    Tasks runtime requirements.

    +

    Tasks wait time requirements.

    +
    diff --git a/docs/interfaces/src.TasksQueueOptions.html b/docs/interfaces/src.TasksQueueOptions.html index 09d808a6..149e0834 100644 --- a/docs/interfaces/src.TasksQueueOptions.html +++ b/docs/interfaces/src.TasksQueueOptions.html @@ -1,5 +1,5 @@ -TasksQueueOptions | poolifier - v4.4.4

    Interface TasksQueueOptions

    Worker node tasks queue options.

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

    Properties

    concurrency? +TasksQueueOptions | poolifier - v4.4.5

    Interface TasksQueueOptions

    Worker node tasks queue options.

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

    Properties

    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.

    (pool maximum size)^2
     
    -
    tasksFinishedTimeout?: number

    Queued tasks finished timeout in milliseconds at worker node termination.

    +
    tasksFinishedTimeout?: number

    Queued tasks finished timeout in milliseconds at worker node termination.

    2000
     
    -
    tasksStealingOnBackPressure?: boolean

    Whether to enable tasks stealing under back pressure.

    +
    tasksStealingOnBackPressure?: boolean

    Whether to enable tasks stealing under back pressure.

    true
     
    -
    tasksStealingRatio?: number

    Ratio of worker nodes that can steal tasks from another worker node.

    +
    tasksStealingRatio?: number

    Ratio of worker nodes that can steal tasks from another worker node.

    0.6
     
    -
    taskStealing?: boolean

    Whether to enable task stealing on idle.

    +
    taskStealing?: boolean

    Whether to enable task stealing on idle.

    true
     
    -
    +
    diff --git a/docs/interfaces/src.WorkerChoiceStrategyOptions.html b/docs/interfaces/src.WorkerChoiceStrategyOptions.html index 123cf099..b8233b19 100644 --- a/docs/interfaces/src.WorkerChoiceStrategyOptions.html +++ b/docs/interfaces/src.WorkerChoiceStrategyOptions.html @@ -1,5 +1,5 @@ -WorkerChoiceStrategyOptions | poolifier - v4.4.4

    Interface WorkerChoiceStrategyOptions

    Worker choice strategy options.

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

    Properties

    elu? +WorkerChoiceStrategyOptions | poolifier - v4.4.5

    Interface WorkerChoiceStrategyOptions

    Worker choice strategy options.

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

    Properties

    elu? measurement? runTime? waitTime? @@ -8,18 +8,18 @@
    { median: false }
     
    -
    measurement?: "elu" | "runTime" | "waitTime"

    Measurement to use in worker choice strategy supporting it.

    -

    Runtime options.

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

    Measurement to use in worker choice strategy supporting it.

    +

    Runtime options.

    { median: false }
     
    -

    Wait time options.

    +

    Wait time options.

    { 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.

    Weights computed automatically given the CPU performance.
     
    -
    +
    diff --git a/docs/interfaces/src.WorkerError.html b/docs/interfaces/src.WorkerError.html index 1db28b47..d0b48427 100644 --- a/docs/interfaces/src.WorkerError.html +++ b/docs/interfaces/src.WorkerError.html @@ -1,13 +1,13 @@ -WorkerError | poolifier - v4.4.4

    Interface WorkerError<Data>

    Worker error.

    +WorkerError | poolifier - v4.4.5

    Interface WorkerError<Data>

    Worker error.

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

    Type Parameters

    • Data = unknown

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

      -

    Properties

    Properties

    data?: Data

    Data triggering the error.

    -
    error?: Error

    Error object.

    -
    message: string

    Error message.

    -
    name?: string

    Task function name triggering the error.

    -
    stack?: string

    Error stack trace.

    -
    +
    error?: Error

    Error object.

    +
    message: string

    Error message.

    +
    name?: string

    Task function name triggering the error.

    +
    stack?: string

    Error stack trace.

    +
    diff --git a/docs/interfaces/src.WorkerInfo.html b/docs/interfaces/src.WorkerInfo.html index 3c6a2d32..1b058168 100644 --- a/docs/interfaces/src.WorkerInfo.html +++ b/docs/interfaces/src.WorkerInfo.html @@ -1,5 +1,5 @@ -WorkerInfo | poolifier - v4.4.4

    Interface WorkerInfoInternal

    Worker information.

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

    Properties

    backPressure +WorkerInfo | poolifier - v4.4.5

    Interface WorkerInfoInternal

    Worker information.

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

    Properties

    backPressure: boolean

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

    -
    backPressureStealing: boolean

    Back pressure stealing flag. +

    backPressureStealing: boolean

    Back pressure stealing flag. This flag is set to true when worker node is stealing one task from another back pressured worker node.

    -
    continuousStealing: boolean

    Continuous stealing flag. +

    continuousStealing: boolean

    Continuous stealing flag. This flag is set to true when worker node is continuously stealing tasks from other worker nodes.

    -
    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 one task from another worker node.

    -
    stolen: boolean

    Stolen flag. +

    stolen: boolean

    Stolen flag. This flag is set to true when worker node has one task stolen from another worker node.

    -
    taskFunctionsProperties?: TaskFunctionProperties[]

    Task functions properties.

    -
    type: "cluster" | "thread"

    Worker type.

    -
    +
    taskFunctionsProperties?: TaskFunctionProperties[]

    Task functions properties.

    +
    type: "cluster" | "thread"

    Worker type.

    +
    diff --git a/docs/interfaces/src.WorkerNodeEventDetail.html b/docs/interfaces/src.WorkerNodeEventDetail.html index 414f153b..491b1956 100644 --- a/docs/interfaces/src.WorkerNodeEventDetail.html +++ b/docs/interfaces/src.WorkerNodeEventDetail.html @@ -1,4 +1,4 @@ -WorkerNodeEventDetail | poolifier - v4.4.4

    Interface WorkerNodeEventDetailInternal

    Worker node event detail.

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

    Properties

    workerId? +WorkerNodeEventDetail | poolifier - v4.4.5

    Interface WorkerNodeEventDetailInternal

    Worker node event detail.

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

    Properties

    workerId?: number
    workerNodeKey?: number
    +

    Properties

    workerId?: number
    workerNodeKey?: number
    diff --git a/docs/interfaces/src.WorkerNodeOptions.html b/docs/interfaces/src.WorkerNodeOptions.html index 5dd61ff3..3bc73444 100644 --- a/docs/interfaces/src.WorkerNodeOptions.html +++ b/docs/interfaces/src.WorkerNodeOptions.html @@ -1,7 +1,7 @@ -WorkerNodeOptions | poolifier - v4.4.4

    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.4.5

    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
    +

    Properties

    env?: Record<string, unknown>
    tasksQueueBackPressureSize: undefined | number
    tasksQueueBucketSize: undefined | number
    tasksQueuePriority: undefined | boolean
    workerOptions?: WorkerOptions
    diff --git a/docs/interfaces/src.WorkerOptions.html b/docs/interfaces/src.WorkerOptions.html index 49a9cd78..24e0b1bf 100644 --- a/docs/interfaces/src.WorkerOptions.html +++ b/docs/interfaces/src.WorkerOptions.html @@ -1,5 +1,5 @@ -WorkerOptions | poolifier - v4.4.4

    Interface WorkerOptions

    Options for workers.

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

    Properties

    killBehavior? +WorkerOptions | poolifier - v4.4.5

    Interface WorkerOptions

    Options for workers.

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

    Properties

    killBehavior?: "HARD" | "SOFT"

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

    @@ -11,9 +11,9 @@
    KillBehaviors.SOFT
     
    -
    killHandler?: KillHandler

    The function to call when a worker is killed.

    +
    killHandler?: KillHandler

    The function to call when a worker is killed.

    () => {}

    -
    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.

      @@ -24,4 +24,4 @@ when this timeout expires your tasks is interrupted before completion and remove
    60000
     
    -
    +
    diff --git a/docs/interfaces/src.WorkerStatistics.html b/docs/interfaces/src.WorkerStatistics.html index 02ec09d2..945eec9a 100644 --- a/docs/interfaces/src.WorkerStatistics.html +++ b/docs/interfaces/src.WorkerStatistics.html @@ -1,6 +1,6 @@ -WorkerStatistics | poolifier - v4.4.4

    Interface WorkerStatisticsInternal

    Worker task performance statistics computation settings.

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

    Properties

    elu +WorkerStatistics | poolifier - v4.4.5

    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.

    -
    +
    runTime: boolean

    Whether the worker computes the task runtime or not.

    +
    diff --git a/docs/interfaces/src.WorkerUsage.html b/docs/interfaces/src.WorkerUsage.html index d03e0452..3878eb48 100644 --- a/docs/interfaces/src.WorkerUsage.html +++ b/docs/interfaces/src.WorkerUsage.html @@ -1,10 +1,10 @@ -WorkerUsage | poolifier - v4.4.4

    Interface WorkerUsageInternal

    Worker usage statistics.

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

    Properties

    elu +WorkerUsage | poolifier - v4.4.5

    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.

    -
    +

    Tasks runtime statistics.

    +

    Tasks statistics.

    +

    Tasks wait time statistics.

    +
    diff --git a/docs/modules/src.html b/docs/modules/src.html index b9897891..ebbcec27 100644 --- a/docs/modules/src.html +++ b/docs/modules/src.html @@ -1,4 +1,4 @@ -src | poolifier - v4.4.4

    Module src

    Index

    Classes

    AbstractPool +src | poolifier - v4.4.5
    +
    diff --git a/docs/types/src.ClusterPoolOptions.html b/docs/types/src.ClusterPoolOptions.html index 097198d0..88ee67d5 100644 --- a/docs/types/src.ClusterPoolOptions.html +++ b/docs/types/src.ClusterPoolOptions.html @@ -1,2 +1,2 @@ -ClusterPoolOptions | poolifier - v4.4.4

    Type Alias ClusterPoolOptions

    ClusterPoolOptions: PoolOptions<Worker>

    Options for a poolifier cluster pool.

    -
    +ClusterPoolOptions | poolifier - v4.4.5

    Type Alias ClusterPoolOptions

    ClusterPoolOptions: PoolOptions<Worker>

    Options for a poolifier cluster pool.

    +
    diff --git a/docs/types/src.ErrorHandler.html b/docs/types/src.ErrorHandler.html index 653024e7..41d538d3 100644 --- a/docs/types/src.ErrorHandler.html +++ b/docs/types/src.ErrorHandler.html @@ -1,3 +1,3 @@ -ErrorHandler | poolifier - v4.4.4

    Type Alias ErrorHandler<Worker>

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

    Callback invoked if the worker raised an error.

    +ErrorHandler | poolifier - v4.4.5

    Type Alias ErrorHandler<Worker>

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

    Callback invoked if the worker raised an error.

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -
    +
    diff --git a/docs/types/src.EventHandler.html b/docs/types/src.EventHandler.html index 5846f858..d9510f9e 100644 --- a/docs/types/src.EventHandler.html +++ b/docs/types/src.EventHandler.html @@ -1,3 +1,3 @@ -EventHandler | poolifier - v4.4.4

    Type Alias EventHandler<Worker>

    EventHandler<Worker>:
        | ErrorHandler<Worker>
        | ExitHandler<Worker>
        | MessageHandler<Worker>
        | OnlineHandler<Worker>

    Worker event handler.

    +EventHandler | poolifier - v4.4.5

    Type Alias EventHandler<Worker>

    EventHandler<Worker>:
        | ErrorHandler<Worker>
        | ExitHandler<Worker>
        | MessageHandler<Worker>
        | OnlineHandler<Worker>

    Worker event handler.

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -
    +
    diff --git a/docs/types/src.ExitHandler.html b/docs/types/src.ExitHandler.html index 8c672b38..f19a8518 100644 --- a/docs/types/src.ExitHandler.html +++ b/docs/types/src.ExitHandler.html @@ -1,3 +1,3 @@ -ExitHandler | poolifier - v4.4.4

    Type Alias ExitHandler<Worker>

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

    Callback invoked when the worker exits successfully.

    +ExitHandler | poolifier - v4.4.5

    Type Alias ExitHandler<Worker>

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

    Callback invoked when the worker exits successfully.

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -
    +
    diff --git a/docs/types/src.KillBehavior.html b/docs/types/src.KillBehavior.html index eb49cab4..8269038b 100644 --- a/docs/types/src.KillBehavior.html +++ b/docs/types/src.KillBehavior.html @@ -1,2 +1,2 @@ -KillBehavior | poolifier - v4.4.4

    Type Alias KillBehavior

    KillBehavior: keyof typeof KillBehaviors

    Kill behavior.

    -
    +KillBehavior | poolifier - v4.4.5

    Type Alias KillBehavior

    KillBehavior: keyof typeof KillBehaviors

    Kill behavior.

    +
    diff --git a/docs/types/src.KillHandler.html b/docs/types/src.KillHandler.html index 124f47f4..1d802c7d 100644 --- a/docs/types/src.KillHandler.html +++ b/docs/types/src.KillHandler.html @@ -1,2 +1,2 @@ -KillHandler | poolifier - v4.4.4

    Type Alias KillHandler

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

    Handler called when a worker is killed.

    -
    +KillHandler | poolifier - v4.4.5

    Type Alias KillHandler

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

    Handler called when a worker is killed.

    +
    diff --git a/docs/types/src.Measurement.html b/docs/types/src.Measurement.html index 875be314..6d48609c 100644 --- a/docs/types/src.Measurement.html +++ b/docs/types/src.Measurement.html @@ -1,2 +1,2 @@ -Measurement | poolifier - v4.4.4

    Type Alias Measurement

    Measurement: keyof typeof Measurements

    Measurement.

    -
    +Measurement | poolifier - v4.4.5

    Type Alias Measurement

    Measurement: keyof typeof Measurements

    Measurement.

    +
    diff --git a/docs/types/src.MessageHandler.html b/docs/types/src.MessageHandler.html index 19927f4c..bd6df585 100644 --- a/docs/types/src.MessageHandler.html +++ b/docs/types/src.MessageHandler.html @@ -1,3 +1,3 @@ -MessageHandler | poolifier - v4.4.4

    Type Alias MessageHandler<Worker>

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

    Callback invoked if the worker has received a message.

    +MessageHandler | poolifier - v4.4.5

    Type Alias MessageHandler<Worker>

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

    Callback invoked if the worker has received a message.

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -
    +
    diff --git a/docs/types/src.OnlineHandler.html b/docs/types/src.OnlineHandler.html index bb0ee6b4..cbfb223e 100644 --- a/docs/types/src.OnlineHandler.html +++ b/docs/types/src.OnlineHandler.html @@ -1,3 +1,3 @@ -OnlineHandler | poolifier - v4.4.4

    Type Alias OnlineHandler<Worker>

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

    Callback invoked when the worker has started successfully.

    +OnlineHandler | poolifier - v4.4.5

    Type Alias OnlineHandler<Worker>

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

    Callback invoked when the worker has started successfully.

    Type Parameters

    • Worker extends IWorker

      Type of worker.

      -
    +
    diff --git a/docs/types/src.PoolEvent.html b/docs/types/src.PoolEvent.html index 454f553d..d65deb63 100644 --- a/docs/types/src.PoolEvent.html +++ b/docs/types/src.PoolEvent.html @@ -1,2 +1,2 @@ -PoolEvent | poolifier - v4.4.4

    Type Alias PoolEvent

    PoolEvent: keyof typeof PoolEvents

    Pool event.

    -
    +PoolEvent | poolifier - v4.4.5

    Type Alias PoolEvent

    PoolEvent: keyof typeof PoolEvents

    Pool event.

    +
    diff --git a/docs/types/src.PoolType.html b/docs/types/src.PoolType.html index dab09f40..33dd6075 100644 --- a/docs/types/src.PoolType.html +++ b/docs/types/src.PoolType.html @@ -1,2 +1,2 @@ -PoolType | poolifier - v4.4.4

    Type Alias PoolType

    PoolType: keyof typeof PoolTypes

    Pool type.

    -
    +PoolType | poolifier - v4.4.5

    Type Alias PoolType

    PoolType: keyof typeof PoolTypes

    Pool type.

    +
    diff --git a/docs/types/src.TaskAsyncFunction.html b/docs/types/src.TaskAsyncFunction.html index 177d3d59..d27a5cfd 100644 --- a/docs/types/src.TaskAsyncFunction.html +++ b/docs/types/src.TaskAsyncFunction.html @@ -1,7 +1,7 @@ -TaskAsyncFunction | poolifier - v4.4.4

    Type Alias TaskAsyncFunction<Data, Response>

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

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

    Type Alias TaskAsyncFunction<Data, Response>

    TaskAsyncFunction<Data, Response>: ((data?: 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

        • Optionaldata: Data

          Data sent to the worker.

        Returns Promise<Response>

        Execution response promise.

        -
    +
    diff --git a/docs/types/src.TaskFunction.html b/docs/types/src.TaskFunction.html index 4f998cf9..2162c747 100644 --- a/docs/types/src.TaskFunction.html +++ b/docs/types/src.TaskFunction.html @@ -1,5 +1,5 @@ -TaskFunction | poolifier - v4.4.4

    Type Alias TaskFunction<Data, Response>

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

    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.

      -
    +
    diff --git a/docs/types/src.TaskFunctions.html b/docs/types/src.TaskFunctions.html index 493b1696..fadf61f0 100644 --- a/docs/types/src.TaskFunctions.html +++ b/docs/types/src.TaskFunctions.html @@ -1,6 +1,6 @@ -TaskFunctions | poolifier - v4.4.4

    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.4.5

    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.

      -
    +
    diff --git a/docs/types/src.TaskSyncFunction.html b/docs/types/src.TaskSyncFunction.html index e7e5ef17..cba9945e 100644 --- a/docs/types/src.TaskSyncFunction.html +++ b/docs/types/src.TaskSyncFunction.html @@ -1,6 +1,6 @@ -TaskSyncFunction | poolifier - v4.4.4

    Type Alias TaskSyncFunction<Data, Response>

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

    Task synchronous function that can be executed.

    +TaskSyncFunction | poolifier - v4.4.5

    Type Alias TaskSyncFunction<Data, Response>

    TaskSyncFunction<Data, Response>: ((data?: 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

      • (data?): Response
      • Parameters

        • Optionaldata: Data

          Data sent to the worker.

        Returns Response

        Execution response.

        -
    +
    diff --git a/docs/types/src.ThreadPoolOptions.html b/docs/types/src.ThreadPoolOptions.html index 0b5c0dfa..120f91f9 100644 --- a/docs/types/src.ThreadPoolOptions.html +++ b/docs/types/src.ThreadPoolOptions.html @@ -1,2 +1,2 @@ -ThreadPoolOptions | poolifier - v4.4.4

    Type Alias ThreadPoolOptions

    ThreadPoolOptions: PoolOptions<Worker>

    Options for a poolifier thread pool.

    -
    +ThreadPoolOptions | poolifier - v4.4.5

    Type Alias ThreadPoolOptions

    ThreadPoolOptions: PoolOptions<Worker>

    Options for a poolifier thread pool.

    +
    diff --git a/docs/types/src.WorkerChoiceStrategy.html b/docs/types/src.WorkerChoiceStrategy.html index 84b72c58..08976214 100644 --- a/docs/types/src.WorkerChoiceStrategy.html +++ b/docs/types/src.WorkerChoiceStrategy.html @@ -1,2 +1,2 @@ -WorkerChoiceStrategy | poolifier - v4.4.4

    Type Alias WorkerChoiceStrategy

    WorkerChoiceStrategy: keyof typeof WorkerChoiceStrategies

    Worker choice strategy.

    -
    +WorkerChoiceStrategy | poolifier - v4.4.5

    Type Alias WorkerChoiceStrategy

    WorkerChoiceStrategy: keyof typeof WorkerChoiceStrategies

    Worker choice strategy.

    +
    diff --git a/docs/types/src.WorkerType.html b/docs/types/src.WorkerType.html index 3b7417c5..6190a290 100644 --- a/docs/types/src.WorkerType.html +++ b/docs/types/src.WorkerType.html @@ -1,2 +1,2 @@ -WorkerType | poolifier - v4.4.4

    Type Alias WorkerType

    WorkerType: keyof typeof WorkerTypes

    Worker type.

    -
    +WorkerType | poolifier - v4.4.5

    Type Alias WorkerType

    WorkerType: keyof typeof WorkerTypes

    Worker type.

    +
    diff --git a/docs/types/src.Writable.html b/docs/types/src.Writable.html index 27d0274c..f0b4b1a3b 100644 --- a/docs/types/src.Writable.html +++ b/docs/types/src.Writable.html @@ -1,3 +1,3 @@ -Writable | poolifier - v4.4.4

    Type Alias Writable<T>Internal

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

    Remove readonly modifier from all properties of T.

    +Writable | poolifier - v4.4.5

    Type Alias Writable<T>Internal

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

    Remove readonly modifier from all properties of T.

    Type Parameters

    • T

      Type to remove readonly modifier.

      -
    +
    diff --git a/docs/variables/src.KillBehaviors.html b/docs/variables/src.KillBehaviors.html index 17bbed16..54cf7066 100644 --- a/docs/variables/src.KillBehaviors.html +++ b/docs/variables/src.KillBehaviors.html @@ -1,2 +1,2 @@ -KillBehaviors | poolifier - v4.4.4

    Variable KillBehaviorsConst

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

    Enumeration of kill behaviors.

    -
    +KillBehaviors | poolifier - v4.4.5

    Variable KillBehaviorsConst

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

    Enumeration of kill behaviors.

    +
    diff --git a/docs/variables/src.Measurements.html b/docs/variables/src.Measurements.html index d729f426..b33607aa 100644 --- a/docs/variables/src.Measurements.html +++ b/docs/variables/src.Measurements.html @@ -1,2 +1,2 @@ -Measurements | poolifier - v4.4.4

    Variable MeasurementsConst

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

    Enumeration of measurements.

    -
    +Measurements | poolifier - v4.4.5

    Variable MeasurementsConst

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

    Enumeration of measurements.

    +
    diff --git a/docs/variables/src.PoolEvents.html b/docs/variables/src.PoolEvents.html index daabcedf..83356056 100644 --- a/docs/variables/src.PoolEvents.html +++ b/docs/variables/src.PoolEvents.html @@ -1,2 +1,2 @@ -PoolEvents | poolifier - v4.4.4

    Variable PoolEventsConst

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

    Enumeration of pool events.

    -
    +PoolEvents | poolifier - v4.4.5

    Variable PoolEventsConst

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

    Enumeration of pool events.

    +
    diff --git a/docs/variables/src.PoolTypes.html b/docs/variables/src.PoolTypes.html index b1e62389..fa7fa2b9 100644 --- a/docs/variables/src.PoolTypes.html +++ b/docs/variables/src.PoolTypes.html @@ -1,2 +1,2 @@ -PoolTypes | poolifier - v4.4.4

    Variable PoolTypesConst

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

    Enumeration of pool types.

    -
    +PoolTypes | poolifier - v4.4.5

    Variable PoolTypesConst

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

    Enumeration of pool types.

    +
    diff --git a/docs/variables/src.WorkerChoiceStrategies.html b/docs/variables/src.WorkerChoiceStrategies.html index 0a2bd3c0..2e56343f 100644 --- a/docs/variables/src.WorkerChoiceStrategies.html +++ b/docs/variables/src.WorkerChoiceStrategies.html @@ -1,2 +1,2 @@ -WorkerChoiceStrategies | poolifier - v4.4.4

    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.

    -
    +WorkerChoiceStrategies | poolifier - v4.4.5

    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.

    +
    diff --git a/docs/variables/src.WorkerTypes.html b/docs/variables/src.WorkerTypes.html index cc66bc99..02087298 100644 --- a/docs/variables/src.WorkerTypes.html +++ b/docs/variables/src.WorkerTypes.html @@ -1,2 +1,2 @@ -WorkerTypes | poolifier - v4.4.4

    Variable WorkerTypesConst

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

    Enumeration of worker types.

    -
    +WorkerTypes | poolifier - v4.4.5

    Variable WorkerTypesConst

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

    Enumeration of worker types.

    +
    -- 2.34.1