From abd5fcbefd80cd9f9a9deca49e3472997e89d732 Mon Sep 17 00:00:00 2001 From: Documentation Bot Date: Tue, 1 Jul 2025 17:20:38 +0000 Subject: [PATCH] docs: publish documentation --- docs/assets/hierarchy.js | 2 +- docs/assets/highlight.css | 8 +- docs/classes/src.ClusterWorker.html | 365 ++---------------- docs/classes/src.DynamicClusterPool.html | 66 ++-- docs/classes/src.DynamicThreadPool.html | 66 ++-- docs/classes/src.FixedClusterPool.html | 66 ++-- docs/classes/src.FixedThreadPool.html | 66 ++-- docs/classes/src.ThreadWorker.html | 365 ++---------------- 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 | 2 +- docs/interfaces/src.AbstractPool.html | 66 ++-- docs/interfaces/src.AbstractWorker.html | 196 ++-------- docs/interfaces/src.CircularBuffer.html | 16 +- ...tLoopUtilizationMeasurementStatistics.html | 6 +- docs/interfaces/src.FixedQueueNode.html | 6 +- docs/interfaces/src.IFixedQueue.html | 26 +- docs/interfaces/src.IPool.html | 36 +- docs/interfaces/src.IWorker.html | 36 +- .../interfaces/src.IWorkerChoiceStrategy.html | 18 +- docs/interfaces/src.IWorkerNode.html | 64 +-- docs/interfaces/src.MeasurementOptions.html | 6 +- .../interfaces/src.MeasurementStatistics.html | 16 +- ...src.MeasurementStatisticsRequirements.html | 10 +- docs/interfaces/src.MessageValue.html | 50 +-- docs/interfaces/src.PoolInfo.html | 20 +- docs/interfaces/src.PoolOptions.html | 32 +- docs/interfaces/src.PriorityQueue.html | 24 +- .../src.PromiseResponseWrapper.html | 14 +- docs/interfaces/src.StrategyData.html | 6 +- docs/interfaces/src.StrategyPolicy.html | 8 +- docs/interfaces/src.Task.html | 22 +- 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 | 24 +- .../src.WorkerChoiceStrategiesContext.html | 22 +- .../src.WorkerChoiceStrategyOptions.html | 14 +- docs/interfaces/src.WorkerError.html | 16 +- docs/interfaces/src.WorkerInfo.html | 26 +- .../interfaces/src.WorkerNodeEventDetail.html | 6 +- docs/interfaces/src.WorkerNodeOptions.html | 6 +- docs/interfaces/src.WorkerOptions.html | 12 +- docs/interfaces/src.WorkerStatistics.html | 8 +- docs/interfaces/src.WorkerUsage.html | 12 +- docs/modules/src.html | 2 +- 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 +- 77 files changed, 626 insertions(+), 1390 deletions(-) diff --git a/docs/assets/hierarchy.js b/docs/assets/hierarchy.js index 8e501a387..b9e633b7f 100644 --- a/docs/assets/hierarchy.js +++ b/docs/assets/hierarchy.js @@ -1 +1 @@ -window.hierarchyData = "eJydkzFPwzAQhf/LzabETuI43hAIqQMSQwVD1cEkVxrVTSTblUBV/jtyWsBNqZKwZHDe0/funX0A0zTOglzSjMWEi4hQLvIVAYNrjYWrmtqCPABL/bdWOwQJd2/WGVW456bRQGBb1SVIlnICe6NBQlU7NGtVoL21ppiF8tnG7byn0MpakOBseeP9Nz8e/3NT6dJgDXKZsoxQGiWrlkDMsyDEw2etdlVxr/fWoTmLQpn4jtJxTjkuHVfTHA9aAikLmY/VB5YTiH39AO9s8phnfmguoiDAfGTl8/90zVIPzJP4suXFxqAqJ5T8axju2O+3X/J4YE8+peI8if3ElKc04D+hteodX5Te44iqQ/mIxjueyAPeQtntCI6XTd2on6ybMGPxH+/3tTFbNBNe8NEwOUUeCcJocoySRyKIcnocvSRXVn0mHr5XHhn23N2RcaRQOwRq2y9l67uY" \ No newline at end of file +window.hierarchyData = "eJydkzFvwjAQhf/LzYZihziOt6pVJYZKHVA7IAY3OUqESSTbSK1Q/nvlQFsTinBYIiV5p+/du7s9mKZxFuSCZiwhXEwI5SJfEjC40li4qqktyD2w1D9rtUWQcP9unVGFe2kaDQQ2VV2CZCknsDMaJFS1Q7NSBdo7a4pxKB+v3dbXFFpZCxKcLUe+fvRb43+uK10arEEuUpYRSifTZUsg4Vlg4vGrVtuqeNA769CcWKFM/FjpOEcf5xUX3Rw+tARSFjKfqk8sBxD7+iu8k84TnvmmuZgEBmaRkc9uyZqlHphPk/OU52uDqhwQ8l/B9Yz9fPshxwN78iER59PEd0x5SgP+M1qrPvBV6R1GRB3KIxLveCIPeHNlNxEcLxs6Ud9Z12HGkn/u960xGzQDLvhQMNiFoILQnHb77F8CK8fj6Dm5MOoTccRe5TQ83sOOxJFC7TVQ234DcnO7rA==" \ No newline at end of file diff --git a/docs/assets/highlight.css b/docs/assets/highlight.css index e1ed7bee0..ca19fc8e9 100644 --- a/docs/assets/highlight.css +++ b/docs/assets/highlight.css @@ -13,10 +13,10 @@ --dark-hl-5: #4FC1FF; --light-hl-6: #795E26; --dark-hl-6: #DCDCAA; - --light-hl-7: #098658; - --dark-hl-7: #B5CEA8; - --light-hl-8: #008000; - --dark-hl-8: #6A9955; + --light-hl-7: #008000; + --dark-hl-7: #6A9955; + --light-hl-8: #098658; + --dark-hl-8: #B5CEA8; --light-hl-9: #267F99; --dark-hl-9: #4EC9B0; --light-hl-10: #000000; diff --git a/docs/classes/src.ClusterWorker.html b/docs/classes/src.ClusterWorker.html index 8f88e0f6c..05d7801b4 100644 --- a/docs/classes/src.ClusterWorker.html +++ b/docs/classes/src.ClusterWorker.html @@ -1,4 +1,4 @@ -ClusterWorker | poolifier - v5.0.0
poolifier - v5.0.0
    Preparing search index...

    Class ClusterWorker<Data, Response>

    A cluster worker used by a poolifier ClusterPool.

    +ClusterWorker | poolifier - v5.0.1
    poolifier - v5.0.1
      Preparing search index...

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

      Index

      Constructors

      Hierarchy (View Summary)

      Index

      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.

      -
      taskAbortFunctions: Map<
          `${string}-${string}-${string}-${string}-${string}`,
          () => void,
      >

      Task abort functions processed by the worker when task operation 'abort' is received.

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

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

      -
      captureRejections: boolean

      Value: boolean

      -

      Change the default captureRejections option on all new EventEmitter objects.

      -

      v13.4.0, v12.16.0

      -
      captureRejectionSymbol: typeof captureRejectionSymbol

      Value: Symbol.for('nodejs.rejection')

      -

      See how to write a custom rejection handler.

      -

      v13.4.0, v12.16.0

      -
      defaultMaxListeners: number

      By default, a maximum of 10 listeners can be registered for any single -event. This limit can be changed for individual EventEmitter instances -using the emitter.setMaxListeners(n) method. To change the default -for allEventEmitter instances, the events.defaultMaxListeners property -can be used. If this value is not a positive number, a RangeError is thrown.

      -

      Take caution when setting the events.defaultMaxListeners because the -change affects all EventEmitter instances, including those created before -the change is made. However, calling emitter.setMaxListeners(n) still has -precedence over events.defaultMaxListeners.

      -

      This is not a hard limit. The EventEmitter instance will allow -more listeners to be added but will output a trace warning to stderr indicating -that a "possible EventEmitter memory leak" has been detected. For any single -EventEmitter, the emitter.getMaxListeners() and emitter.setMaxListeners() methods can be used to -temporarily avoid this warning:

      -
      import { EventEmitter } from 'node:events';
      const emitter = new EventEmitter();
      emitter.setMaxListeners(emitter.getMaxListeners() + 1);
      emitter.once('event', () => {
      // do stuff
      emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0));
      }); -
      - -

      The --trace-warnings command-line flag can be used to display the -stack trace for such warnings.

      -

      The emitted warning can be inspected with process.on('warning') and will -have the additional emitter, type, and count properties, referring to -the event emitter instance, the event's name and the number of attached -listeners, respectively. -Its name property is set to 'MaxListenersExceededWarning'.

      -

      v0.11.2

      -
      errorMonitor: typeof errorMonitor

      This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

      -

      Installing a listener using this symbol does not change the behavior once an 'error' event is emitted. Therefore, the process will still crash if no -regular 'error' listener is installed.

      -

      v13.6.0, v12.17.0

      -

      Accessors

      Methods

      • Type Parameters

        • K

        Parameters

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

        Returns void

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

        -

        Type Parameters

        • K

        Parameters

        • eventName: string | symbol
        • listener: (...args: any[]) => void

        Returns this

        v0.1.26

        -

      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.

      +
      taskAbortFunctions: Map<
          `${string}-${string}-${string}-${string}-${string}`,
          () => void,
      >

      Task abort functions processed by the worker when task operation 'abort' is received.

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

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

      +

      Accessors

      Methods

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

        -

        Returns true if the event had listeners, false otherwise.

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

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

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

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

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

        Type Parameters

        • K

        Parameters

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

        Returns boolean

        v0.1.26

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

        -
        import { EventEmitter } from 'node:events';

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

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

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

        Returns (string | symbol)[]

        v6.0.0

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

        -

        Returns number

        v1.0.0

        -

      Returns void

      Returns void

      Returns void

      Returns void

      Returns void

      Returns void

      Returns void

      +
      diff --git a/docs/classes/src.DynamicClusterPool.html b/docs/classes/src.DynamicClusterPool.html index 642435d48..2668b4bde 100644 --- a/docs/classes/src.DynamicClusterPool.html +++ b/docs/classes/src.DynamicClusterPool.html @@ -1,11 +1,11 @@ -DynamicClusterPool | poolifier - v5.0.0
      poolifier - v5.0.0
        Preparing search index...

        Class DynamicClusterPool<Data, Response>

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

        +DynamicClusterPool | poolifier - v5.0.1
        poolifier - v5.0.1
          Preparing search index...

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

          Index

          Constructors

          Hierarchy (View Summary)

          Index

          Constructors

          Properties

          emitter? filePath maximumNumberOfWorkers? @@ -59,70 +59,70 @@ 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
          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:

          +

          Returns DynamicClusterPool<Data, Response>

          Properties

          emitter?: EventEmitterAsyncResource
          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>[] = []

          Accessors

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

          Worker choice strategies context referencing worker choice algorithms implementation.

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

          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

          • Hook executed after the worker task execution. +

            Returns "fixed" | "dynamic"

          • get worker(): "cluster" | "thread"

            The worker type.

            +

            Returns "cluster" | "thread"

          Methods

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

          Returns void

          Returns void

          Returns void

          Returns void

          Returns Promise<void>

          Returns void

          Returns void

          Returns void

          Returns void

          +

          Returns void

          diff --git a/docs/classes/src.DynamicThreadPool.html b/docs/classes/src.DynamicThreadPool.html index 29580c7d0..b51133086 100644 --- a/docs/classes/src.DynamicThreadPool.html +++ b/docs/classes/src.DynamicThreadPool.html @@ -1,11 +1,11 @@ -DynamicThreadPool | poolifier - v5.0.0
          poolifier - v5.0.0
            Preparing search index...

            Class DynamicThreadPool<Data, Response>

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

            +DynamicThreadPool | poolifier - v5.0.1
            poolifier - v5.0.1
              Preparing search index...

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

              Index

              Constructors

              Hierarchy (View Summary)

              Index

              Constructors

              Properties

              emitter? filePath maximumNumberOfWorkers? @@ -59,71 +59,71 @@ 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
              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:

              +

              Returns DynamicThreadPool<Data, Response>

              Properties

              emitter?: EventEmitterAsyncResource
              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>[] = []

              Accessors

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

              Worker choice strategies context referencing worker choice algorithms implementation.

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

              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

              • Hook executed after the worker task execution. +

                Returns "fixed" | "dynamic"

              • get worker(): "cluster" | "thread"

                The worker type.

                +

                Returns "cluster" | "thread"

              Methods

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

              Returns void

              Returns void

              Returns void

              Returns void

              Returns Promise<void>

              Returns void

              Returns void

              Returns void

              Returns void

              +

              Returns void

              diff --git a/docs/classes/src.FixedClusterPool.html b/docs/classes/src.FixedClusterPool.html index f6e2d787a..353f12ddb 100644 --- a/docs/classes/src.FixedClusterPool.html +++ b/docs/classes/src.FixedClusterPool.html @@ -1,9 +1,9 @@ -FixedClusterPool | poolifier - v5.0.0
              poolifier - v5.0.0
                Preparing search index...

                Class FixedClusterPool<Data, Response>

                A cluster pool with a fixed number of workers.

                +FixedClusterPool | poolifier - v5.0.1
                poolifier - v5.0.1
                  Preparing search index...

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

                  Index

                  Constructors

                  Hierarchy (View Summary)

                  Index

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

                  +

                  Returns FixedClusterPool<Data, Response>

                  Properties

                  emitter?: EventEmitterAsyncResource
                  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>[] = []

                  Accessors

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

                  Worker choice strategies context referencing worker choice algorithms implementation.

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

                  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

                  • Hook executed after the worker task execution. +

                    Returns "fixed" | "dynamic"

                  • get worker(): "cluster" | "thread"

                    The worker type.

                    +

                    Returns "cluster" | "thread"

                  Methods

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

                  Returns void

                  Returns void

                  Returns void

                  Returns void

                  Returns Promise<void>

                  Returns void

                  Returns void

                  Returns void

                  Returns void

                  +

                  Returns void

                  diff --git a/docs/classes/src.FixedThreadPool.html b/docs/classes/src.FixedThreadPool.html index 167a8afc5..5ea533c01 100644 --- a/docs/classes/src.FixedThreadPool.html +++ b/docs/classes/src.FixedThreadPool.html @@ -1,9 +1,9 @@ -FixedThreadPool | poolifier - v5.0.0
                  poolifier - v5.0.0
                    Preparing search index...

                    Class FixedThreadPool<Data, Response>

                    A thread pool with a fixed number of threads.

                    +FixedThreadPool | poolifier - v5.0.1
                    poolifier - v5.0.1
                      Preparing search index...

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

                      Index

                      Constructors

                      Hierarchy (View Summary)

                      Index

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

                      +

                      Returns FixedThreadPool<Data, Response>

                      Properties

                      emitter?: EventEmitterAsyncResource
                      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>[] = []

                      Accessors

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

                      Worker choice strategies context referencing worker choice algorithms implementation.

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

                      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

                      • Hook executed after the worker task execution. +

                        Returns "fixed" | "dynamic"

                      • get worker(): "cluster" | "thread"

                        The worker type.

                        +

                        Returns "cluster" | "thread"

                      Methods

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

                      Returns void

                      Returns void

                      Returns void

                      Returns void

                      Returns Promise<void>

                      Returns void

                      Returns void

                      Returns void

                      Returns void

                      +

                      Returns void

                      diff --git a/docs/classes/src.ThreadWorker.html b/docs/classes/src.ThreadWorker.html index 79b3eeb2a..03c711e10 100644 --- a/docs/classes/src.ThreadWorker.html +++ b/docs/classes/src.ThreadWorker.html @@ -1,4 +1,4 @@ -ThreadWorker | poolifier - v5.0.0
                      poolifier - v5.0.0
                        Preparing search index...

                        Class ThreadWorker<Data, Response>

                        A thread worker used by a poolifier ThreadPool.

                        +ThreadWorker | poolifier - v5.0.1
                        poolifier - v5.0.1
                          Preparing search index...

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

                          Index

                          Constructors

                          Hierarchy (View Summary)

                          Index

                          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.

                          -
                          taskAbortFunctions: Map<
                              `${string}-${string}-${string}-${string}-${string}`,
                              () => void,
                          >

                          Task abort functions processed by the worker when task operation 'abort' is received.

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

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

                          -
                          captureRejections: boolean

                          Value: boolean

                          -

                          Change the default captureRejections option on all new EventEmitter objects.

                          -

                          v13.4.0, v12.16.0

                          -
                          captureRejectionSymbol: typeof captureRejectionSymbol

                          Value: Symbol.for('nodejs.rejection')

                          -

                          See how to write a custom rejection handler.

                          -

                          v13.4.0, v12.16.0

                          -
                          defaultMaxListeners: number

                          By default, a maximum of 10 listeners can be registered for any single -event. This limit can be changed for individual EventEmitter instances -using the emitter.setMaxListeners(n) method. To change the default -for allEventEmitter instances, the events.defaultMaxListeners property -can be used. If this value is not a positive number, a RangeError is thrown.

                          -

                          Take caution when setting the events.defaultMaxListeners because the -change affects all EventEmitter instances, including those created before -the change is made. However, calling emitter.setMaxListeners(n) still has -precedence over events.defaultMaxListeners.

                          -

                          This is not a hard limit. The EventEmitter instance will allow -more listeners to be added but will output a trace warning to stderr indicating -that a "possible EventEmitter memory leak" has been detected. For any single -EventEmitter, the emitter.getMaxListeners() and emitter.setMaxListeners() methods can be used to -temporarily avoid this warning:

                          -
                          import { EventEmitter } from 'node:events';
                          const emitter = new EventEmitter();
                          emitter.setMaxListeners(emitter.getMaxListeners() + 1);
                          emitter.once('event', () => {
                          // do stuff
                          emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0));
                          }); -
                          - -

                          The --trace-warnings command-line flag can be used to display the -stack trace for such warnings.

                          -

                          The emitted warning can be inspected with process.on('warning') and will -have the additional emitter, type, and count properties, referring to -the event emitter instance, the event's name and the number of attached -listeners, respectively. -Its name property is set to 'MaxListenersExceededWarning'.

                          -

                          v0.11.2

                          -
                          errorMonitor: typeof errorMonitor

                          This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

                          -

                          Installing a listener using this symbol does not change the behavior once an 'error' event is emitted. Therefore, the process will still crash if no -regular 'error' listener is installed.

                          -

                          v13.6.0, v12.17.0

                          -

                          Accessors

                          Methods

                          • Type Parameters

                            • K

                            Parameters

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

                            Returns void

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

                            -

                            Type Parameters

                            • K

                            Parameters

                            • eventName: string | symbol
                            • listener: (...args: any[]) => void

                            Returns this

                            v0.1.26

                            -

                          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.

                          +
                          taskAbortFunctions: Map<
                              `${string}-${string}-${string}-${string}-${string}`,
                              () => void,
                          >

                          Task abort functions processed by the worker when task operation 'abort' is received.

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

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

                          +

                          Accessors

                          Methods

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

                            -

                            Returns true if the event had listeners, false otherwise.

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

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

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

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

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

                            Type Parameters

                            • K

                            Parameters

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

                            Returns boolean

                            v0.1.26

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

                            -
                            import { EventEmitter } from 'node:events';

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

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

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

                            Returns (string | symbol)[]

                            v6.0.0

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

                            -

                            Returns number

                            v1.0.0

                            -

                          Returns void

                          Returns void

                          Returns void

                          Returns void

                          Returns void

                          Returns void

                          Returns void

                          +
                          diff --git a/docs/documents/api.html b/docs/documents/api.html index 9b28d62d6..dfdba5824 100644 --- a/docs/documents/api.html +++ b/docs/documents/api.html @@ -1,4 +1,4 @@ -api | poolifier - v5.0.0
                          poolifier - v5.0.0
                            Preparing search index...

                            API

                            diff --git a/docs/documents/general-guidelines.html b/docs/documents/general-guidelines.html index 9d8c59b16..ee6a768c7 100644 --- a/docs/documents/general-guidelines.html +++ b/docs/documents/general-guidelines.html @@ -1,4 +1,4 @@ -general-guidelines | poolifier - v5.0.0
                            poolifier - v5.0.0
                              Preparing search index...

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

                              poolifier - v5.0.1
                                Preparing search index...

                                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 3dc309254..3f7ad6514 100644 --- a/docs/documents/worker-choice-strategies.html +++ b/docs/documents/worker-choice-strategies.html @@ -1,4 +1,4 @@ -worker-choice-strategies | poolifier - v5.0.0
                                poolifier - v5.0.0
                                  Preparing search index...

                                  Worker choice strategies

                                  All duration or timestamp are expressed in milliseconds.

                                  +worker-choice-strategies | poolifier - v5.0.1
                                  poolifier - v5.0.1
                                    Preparing search index...

                                    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 11b1cfade..6425a0b03 100644 --- a/docs/functions/src.availableParallelism.html +++ b/docs/functions/src.availableParallelism.html @@ -1,4 +1,4 @@ -availableParallelism | poolifier - v5.0.0
                                    poolifier - v5.0.0
                                      Preparing search index...

                                      Function availableParallelism

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

                                        poolifier - v5.0.1
                                          Preparing search index...

                                          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 28c579254..a7373ce5e 100644 --- a/docs/hierarchy.html +++ b/docs/hierarchy.html @@ -1 +1 @@ -poolifier - v5.0.0
                                        poolifier - v5.0.0
                                          Preparing search index...
                                          +poolifier - v5.0.1
                                          poolifier - v5.0.1
                                            Preparing search index...
                                            diff --git a/docs/index.html b/docs/index.html index 580350650..0a362ae02 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -poolifier - v5.0.0
                                            poolifier - v5.0.0
                                              Preparing search index...

                                              poolifier - v5.0.0

                                              Documents

                                              api
                                              general-guidelines
                                              worker-choice-strategies

                                              Modules

                                              src
                                              +poolifier - v5.0.1
                                              poolifier - v5.0.1
                                                Preparing search index...

                                                poolifier - v5.0.1

                                                Documents

                                                api
                                                general-guidelines
                                                worker-choice-strategies

                                                Modules

                                                src
                                                diff --git a/docs/interfaces/src.AbstractPool.html b/docs/interfaces/src.AbstractPool.html index ec70c4c90..dd6f3521c 100644 --- a/docs/interfaces/src.AbstractPool.html +++ b/docs/interfaces/src.AbstractPool.html @@ -1,8 +1,8 @@ -AbstractPool | poolifier - v5.0.0
                                                poolifier - v5.0.0
                                                  Preparing search index...

                                                  Interface AbstractPool<Worker, Data, Response>Abstract

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

                                                  +AbstractPool | poolifier - v5.0.1
                                                  poolifier - v5.0.1
                                                    Preparing search index...

                                                    Interface AbstractPool<Worker, Data, Response>Abstract

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

                                                    interface AbstractPool<
                                                        Worker extends IWorker,
                                                        Data = unknown,
                                                        Response = unknown,
                                                    > {
                                                        emitter?: EventEmitterAsyncResource;
                                                        filePath: string;
                                                        maximumNumberOfWorkers?: number;
                                                        minimumNumberOfWorkers: number;
                                                        opts: PoolOptions<Worker>;
                                                        promiseResponseMap: Map<
                                                            `${string}-${string}-${string}-${string}-${string}`,
                                                            PromiseResponseWrapper<Response>,
                                                        >;
                                                        workerChoiceStrategiesContext?: WorkerChoiceStrategiesContext<
                                                            Worker,
                                                            Data,
                                                            Response,
                                                        >;
                                                        workerNodes: IWorkerNode<Worker, Data>[];
                                                        get backPressure(): boolean;
                                                        get busy(): boolean;
                                                        get info(): PoolInfo;
                                                        get type(): "fixed" | "dynamic";
                                                        get worker(): "cluster" | "thread";
                                                        addTaskFunction(
                                                            name: string,
                                                            fn: TaskFunction<Data, Response> | TaskFunctionObject<Data, Response>,
                                                        ): Promise<boolean>;
                                                        afterTaskExecutionHook(
                                                            workerNodeKey: number,
                                                            message: MessageValue<Response>,
                                                        ): void;
                                                        afterWorkerNodeSetup(workerNodeKey: number): void;
                                                        beforeTaskExecutionHook(workerNodeKey: number, task: Task<Data>): void;
                                                        checkAndEmitDynamicWorkerCreationEvents(): void;
                                                        checkAndEmitDynamicWorkerDestructionEvents(): void;
                                                        createAndSetupDynamicWorkerNode(): number;
                                                        createAndSetupWorkerNode(): number;
                                                        deregisterWorkerMessageListener<Message>(
                                                            workerNodeKey: number,
                                                            listener: (message: MessageValue<Message>) => void,
                                                        ): void;
                                                        destroy(): Promise<void>;
                                                        destroyWorkerNode(workerNodeKey: number): Promise<void>;
                                                        enableTasksQueue(
                                                            enable: boolean,
                                                            tasksQueueOptions?: TasksQueueOptions,
                                                        ): void;
                                                        execute(
                                                            data?: Data,
                                                            name?: string,
                                                            abortSignal?: AbortSignal,
                                                            transferList?: readonly Transferable[],
                                                        ): Promise<Response>;
                                                        flagWorkerNodeAsNotReady(workerNodeKey: number): void;
                                                        flushTasksQueue(workerNodeKey: number): number;
                                                        getWorkerInfo(workerNodeKey: number): undefined | WorkerInfo;
                                                        hasTaskFunction(name: string): boolean;
                                                        internalBackPressure(): boolean;
                                                        internalBusy(): boolean;
                                                        isMain(): boolean;
                                                        listTaskFunctionsProperties(): TaskFunctionProperties[];
                                                        mapExecute(
                                                            data: Iterable<Data>,
                                                            name?: string,
                                                            abortSignals?: Iterable<AbortSignal, any, any>,
                                                            transferList?: readonly Transferable[],
                                                        ): Promise<Response[]>;
                                                        registerOnceWorkerMessageListener<Message>(
                                                            workerNodeKey: number,
                                                            listener: (message: MessageValue<Message>) => void,
                                                        ): void;
                                                        registerWorkerMessageListener<Message>(
                                                            workerNodeKey: number,
                                                            listener: (message: MessageValue<Message>) => void,
                                                        ): void;
                                                        removeTaskFunction(name: string): Promise<boolean>;
                                                        sendStartupMessageToWorker(workerNodeKey: number): void;
                                                        sendToWorker(
                                                            workerNodeKey: number,
                                                            message: MessageValue<Data>,
                                                            transferList?: readonly Transferable[],
                                                        ): void;
                                                        setDefaultTaskFunction(name: string): Promise<boolean>;
                                                        setTasksQueueOptions(
                                                            tasksQueueOptions: undefined | TasksQueueOptions,
                                                        ): void;
                                                        setupHook(): 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: undefined | WorkerChoiceStrategyOptions,
                                                        ): boolean;
                                                        shallCreateDynamicWorker(): boolean;
                                                        start(): void;
                                                        workerMessageListener(message: MessageValue<Response>): void;
                                                    }

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

                                                    Implements

                                                    Index

                                                    Properties

                                                    Hierarchy (View Summary)

                                                    Implements

                                                    Index

                                                    Properties

                                                    emitter?: EventEmitterAsyncResource
                                                    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:

                                                    +

                                                    Properties

                                                    emitter?: EventEmitterAsyncResource
                                                    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>[] = []

                                                    Accessors

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

                                                    Worker choice strategies context referencing worker choice algorithms implementation.

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

                                                    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

                                                    Methods

                                                    • 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

                                                    Returns void

                                                    Returns void

                                                    Returns Promise<void>

                                                    Returns void

                                                    Returns void

                                                    Returns void

                                                    Returns void

                                                    +

                                                    Returns void

                                                    diff --git a/docs/interfaces/src.AbstractWorker.html b/docs/interfaces/src.AbstractWorker.html index 7fe2e1955..c9243eed1 100644 --- a/docs/interfaces/src.AbstractWorker.html +++ b/docs/interfaces/src.AbstractWorker.html @@ -1,8 +1,8 @@ -AbstractWorker | poolifier - v5.0.0
                                                    poolifier - v5.0.0
                                                      Preparing search index...

                                                      Interface AbstractWorker<MainWorker, Data, Response>Abstract

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

                                                      -
                                                      interface AbstractWorker<
                                                          MainWorker extends MessagePort
                                                          | Worker,
                                                          Data = unknown,
                                                          Response = unknown,
                                                      > {
                                                          activeInterval?: Timeout;
                                                          id: number;
                                                          isMain: undefined | boolean;
                                                          lastTaskTimestamp: number;
                                                          opts: WorkerOptions;
                                                          statistics?: WorkerStatistics;
                                                          taskAbortFunctions: Map<
                                                              `${string}-${string}-${string}-${string}-${string}`,
                                                              () => void,
                                                          >;
                                                          taskFunctions: Map<string, TaskFunctionObject<Data, Response>>;
                                                          "[captureRejectionSymbol]"<K>(
                                                              error: Error,
                                                              event: string | symbol,
                                                              ...args: AnyRest,
                                                          ): void;
                                                          addListener<K>(
                                                              eventName: string | symbol,
                                                              listener: (...args: any[]) => void,
                                                          ): this;
                                                          addTaskFunction(
                                                              name: string,
                                                              fn: TaskFunctionObject<Data, Response> | TaskFunction<Data, Response>,
                                                          ): TaskFunctionOperationResult;
                                                          emit<K>(eventName: string | symbol, ...args: AnyRest): boolean;
                                                          eventNames(): (string | symbol)[];
                                                          getMainWorker(): MainWorker;
                                                          getMaxListeners(): number;
                                                          handleError(
                                                              error: Error,
                                                          ): { aborted: boolean; error?: Error; message: string; stack?: string };
                                                          handleKillMessage(message: MessageValue<Data>): void;
                                                          handleReadyMessage(message: MessageValue<Data>): void;
                                                          handleTaskFunctionOperationMessage(message: MessageValue<Data>): void;
                                                          hasTaskFunction(name: string): TaskFunctionOperationResult;
                                                          listenerCount<K>(eventName: string | symbol, listener?: Function): number;
                                                          listeners<K>(eventName: string | symbol): Function[];
                                                          listTaskFunctionsProperties(): TaskFunctionProperties[];
                                                          messageListener(message: MessageValue<Data>): void;
                                                          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;
                                                          removeTaskFunction(name: string): TaskFunctionOperationResult;
                                                          run(task: Task<Data>): void;
                                                          runAsync(fn: TaskAsyncFunction<Data, Response>, task: Task<Data>): void;
                                                          runSync(fn: TaskSyncFunction<Data, Response>, task: Task<Data>): void;
                                                          sendTaskFunctionsPropertiesToMainWorker(): void;
                                                          sendToMainWorker(message: MessageValue<Response, Data>): void;
                                                          setDefaultTaskFunction(name: string): TaskFunctionOperationResult;
                                                          setMaxListeners(n: number): this;
                                                      }

                                                      Type Parameters

                                                      Hierarchy (View Summary)

                                                      Index

                                                      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.

                                                      -
                                                      taskAbortFunctions: Map<
                                                          `${string}-${string}-${string}-${string}-${string}`,
                                                          () => void,
                                                      >

                                                      Task abort functions processed by the worker when task operation 'abort' is received.

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

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

                                                      -

                                                      Methods

                                                      • Type Parameters

                                                        • K

                                                        Parameters

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

                                                        Returns void

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

                                                        -

                                                        Type Parameters

                                                        • K

                                                        Parameters

                                                        • eventName: string | symbol
                                                        • listener: (...args: any[]) => void

                                                        Returns this

                                                        v0.1.26

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

                                                      +
                                                      taskAbortFunctions: Map<
                                                          `${string}-${string}-${string}-${string}-${string}`,
                                                          () => void,
                                                      >

                                                      Task abort functions processed by the worker when task operation 'abort' is received.

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

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

                                                      +

                                                      Methods

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

                                                        -

                                                        Returns true if the event had listeners, false otherwise.

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

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

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

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

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

                                                        Type Parameters

                                                        • K

                                                        Parameters

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

                                                        Returns boolean

                                                        v0.1.26

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

                                                        -
                                                        import { EventEmitter } from 'node:events';

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

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

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

                                                        Returns (string | symbol)[]

                                                        v6.0.0

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

                                                        -

                                                        Returns number

                                                        v1.0.0

                                                        -
                                                      • Handles a worker error.

                                                        +
                                                      • Handles a worker error.

                                                        Parameters

                                                        • error: Error

                                                          The error raised by the worker.

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

                                                        The worker error object.

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

                                                        +

                                                      Returns void

                                                      Returns void

                                                      Returns void

                                                      Returns void

                                                      Returns void

                                                      Returns void

                                                      Returns void

                                                      +
                                                      diff --git a/docs/interfaces/src.CircularBuffer.html b/docs/interfaces/src.CircularBuffer.html index da86b0155..ad58e5c07 100644 --- a/docs/interfaces/src.CircularBuffer.html +++ b/docs/interfaces/src.CircularBuffer.html @@ -1,18 +1,18 @@ -CircularBuffer | poolifier - v5.0.0
                                                      poolifier - v5.0.0
                                                        Preparing search index...

                                                        Interface CircularBufferInternal

                                                        Circular buffer designed for positive numbers.

                                                        -
                                                        interface CircularBuffer {
                                                            size: number;
                                                            empty(): boolean;
                                                            full(): boolean;
                                                            get(): undefined | number;
                                                            put(number: number): void;
                                                            toArray(): number[];
                                                        }
                                                        Index

                                                        Properties

                                                        size +CircularBuffer | poolifier - v5.0.1
                                                        poolifier - v5.0.1
                                                          Preparing search index...

                                                          Interface CircularBufferInternal

                                                          Circular buffer designed for positive numbers.

                                                          +
                                                          interface CircularBuffer {
                                                              size: number;
                                                              empty(): boolean;
                                                              full(): boolean;
                                                              get(): undefined | number;
                                                              put(number: number): void;
                                                              toArray(): number[];
                                                          }
                                                          Index

                                                          Properties

                                                          Methods

                                                          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/interfaces/src.EventLoopUtilizationMeasurementStatistics.html b/docs/interfaces/src.EventLoopUtilizationMeasurementStatistics.html index ef26d528f..fbbfd30a0 100644 --- a/docs/interfaces/src.EventLoopUtilizationMeasurementStatistics.html +++ b/docs/interfaces/src.EventLoopUtilizationMeasurementStatistics.html @@ -1,5 +1,5 @@ -EventLoopUtilizationMeasurementStatistics | poolifier - v5.0.0
                                                          poolifier - v5.0.0
                                                            Preparing search index...

                                                            Interface EventLoopUtilizationMeasurementStatisticsInternal

                                                            Event loop utilization measurement statistics.

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

                                                            Properties

                                                            active +EventLoopUtilizationMeasurementStatistics | poolifier - v5.0.1
                                                            poolifier - v5.0.1
                                                              Preparing search index...

                                                              Interface EventLoopUtilizationMeasurementStatisticsInternal

                                                              Event loop utilization measurement statistics.

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

                                                              Properties

                                                              utilization?: number
                                                              +

                                                              Properties

                                                              utilization?: number
                                                              diff --git a/docs/interfaces/src.FixedQueueNode.html b/docs/interfaces/src.FixedQueueNode.html index a82a2477d..1163ef1bd 100644 --- a/docs/interfaces/src.FixedQueueNode.html +++ b/docs/interfaces/src.FixedQueueNode.html @@ -1,5 +1,5 @@ -FixedQueueNode | poolifier - v5.0.0
                                                              poolifier - v5.0.0
                                                                Preparing search index...

                                                                Interface FixedQueueNode<T>Internal

                                                                Fixed queue node.

                                                                +FixedQueueNode | poolifier - v5.0.1
                                                                poolifier - v5.0.1
                                                                  Preparing search index...

                                                                  Interface FixedQueueNode<T>Internal

                                                                  Fixed queue node.

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

                                                                  Type Parameters

                                                                  • T

                                                                    Type of fixed queue node data.

                                                                    -
                                                                  Index

                                                                  Properties

                                                                  Index

                                                                  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 3a5a96985..96aee6184 100644 --- a/docs/interfaces/src.IFixedQueue.html +++ b/docs/interfaces/src.IFixedQueue.html @@ -1,6 +1,6 @@ -IFixedQueue | poolifier - v5.0.0
                                                                  poolifier - v5.0.0
                                                                    Preparing search index...

                                                                    Interface IFixedQueue<T>Internal

                                                                    Fixed queue.

                                                                    +IFixedQueue | poolifier - v5.0.1
                                                                    poolifier - v5.0.1
                                                                      Preparing search index...

                                                                      Interface IFixedQueue<T>Internal

                                                                      Fixed queue.

                                                                      interface IFixedQueue<T> {
                                                                          "[iterator]": () => Iterator<T>;
                                                                          capacity: number;
                                                                          clear: () => void;
                                                                          delete: (data: T) => boolean;
                                                                          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.

                                                                        -
                                                                      Index

                                                                      Properties

                                                                      Index

                                                                      Properties

                                                                      [iterator] capacity clear delete @@ -14,25 +14,25 @@

                                                                      Properties

                                                                      "[iterator]": () => Iterator<T>

                                                                      Returns an iterator for the fixed queue.

                                                                      Type declaration

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

                                                                          An iterator for the fixed queue.

                                                                      capacity: number

                                                                      The fixed queue capacity.

                                                                      -
                                                                      clear: () => void

                                                                      Clears the fixed queue.

                                                                      -
                                                                      delete: (data: T) => boolean

                                                                      Deletes the given data from the fixed priority queue.

                                                                      +
                                                                      capacity: number

                                                                      The fixed queue capacity.

                                                                      +
                                                                      clear: () => void

                                                                      Clears the fixed queue.

                                                                      +
                                                                      delete: (data: T) => boolean

                                                                      Deletes the given data from the fixed priority queue.

                                                                      Type declaration

                                                                        • (data: T): boolean
                                                                        • Parameters

                                                                          • data: T

                                                                            Data to delete.

                                                                          Returns boolean

                                                                          true if the data was deleted, false otherwise.

                                                                          -
                                                                      dequeue: () => undefined | T

                                                                      Dequeue data from 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: T, priority?: number): 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: number): 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 12f7b7b31..2416aa58f 100644 --- a/docs/interfaces/src.IPool.html +++ b/docs/interfaces/src.IPool.html @@ -1,8 +1,8 @@ -IPool | poolifier - v5.0.0
                                                                      poolifier - v5.0.0
                                                                        Preparing search index...

                                                                        Interface IPool<Worker, Data, Response>

                                                                        Contract definition for a poolifier pool.

                                                                        +IPool | poolifier - v5.0.1
                                                                        poolifier - v5.0.1
                                                                          Preparing search index...

                                                                          Interface IPool<Worker, Data, Response>

                                                                          Contract definition for a poolifier pool.

                                                                          interface IPool<Worker extends IWorker, Data = unknown, Response = unknown> {
                                                                              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,
                                                                                  abortSignal?: AbortSignal,
                                                                                  transferList?: readonly Transferable[],
                                                                              ) => Promise<Response>;
                                                                              hasTaskFunction: (name: string) => boolean;
                                                                              info: PoolInfo;
                                                                              listTaskFunctionsProperties: () => TaskFunctionProperties[];
                                                                              mapExecute: (
                                                                                  data: Iterable<Data>,
                                                                                  name?: string,
                                                                                  abortSignals?: Iterable<AbortSignal, any, any>,
                                                                                  transferList?: readonly Transferable[],
                                                                              ) => 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

                                                                          Index

                                                                          Properties

                                                                          Implemented by

                                                                          Index

                                                                          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,41 +42,41 @@ 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: boolean, tasksQueueOptions?: 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,
                                                                              abortSignal?: AbortSignal,
                                                                              transferList?: readonly Transferable[],
                                                                          ) => Promise<Response>

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

                                                                          +

                                                                          Returns void

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

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

                                                                          Type declaration

                                                                            • (
                                                                                  data?: Data,
                                                                                  name?: string,
                                                                                  abortSignal?: AbortSignal,
                                                                                  transferList?: readonly Transferable[],
                                                                              ): 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.

                                                                              • OptionalabortSignal: AbortSignal

                                                                                The optional AbortSignal to abort the task.

                                                                              • OptionaltransferList: readonly Transferable[]

                                                                                The 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: string): 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>,
                                                                              name?: string,
                                                                              abortSignals?: Iterable<AbortSignal, any, any>,
                                                                              transferList?: readonly Transferable[],
                                                                          ) => Promise<Response[]>

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

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

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

                                                                          Type declaration

                                                                            • (
                                                                                  data: Iterable<Data>,
                                                                                  name?: string,
                                                                                  abortSignals?: Iterable<AbortSignal, any, any>,
                                                                                  transferList?: readonly Transferable[],
                                                                              ): Promise<Response[]>
                                                                            • Parameters

                                                                              • data: Iterable<Data>

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

                                                                              • Optionalname: string

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

                                                                              • OptionalabortSignals: Iterable<AbortSignal, any, any>

                                                                                The optional iterable of AbortSignal to abort the tasks iterable.

                                                                              • OptionaltransferList: readonly Transferable[]

                                                                                The 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: string): 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: string): 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

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

                                                                          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 23492b6ba..1cca74120 100644 --- a/docs/interfaces/src.IWorker.html +++ b/docs/interfaces/src.IWorker.html @@ -1,5 +1,5 @@ -IWorker | poolifier - v5.0.0
                                                                          poolifier - v5.0.0
                                                                            Preparing search index...

                                                                            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
                                                                            Index

                                                                            Properties

                                                                            disconnect? +IWorker | poolifier - v5.0.1
                                                                            poolifier - v5.0.1
                                                                              Preparing search index...

                                                                              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
                                                                              Index

                                                                              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

                                                                              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

                                                                              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
                                                                                • ...args: AnyRest

                                                                                Returns void

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

                                                                                +

                                                                              Methods

                                                                              • Type Parameters

                                                                                • K

                                                                                Parameters

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

                                                                                Returns void

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

                                                                                Type Parameters

                                                                                • K

                                                                                Parameters

                                                                                • eventName: string | symbol
                                                                                • listener: (...args: any[]) => 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.

                                                                                Returns true if the event had listeners, false otherwise.

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

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

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

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

                                                                                // Prints:
                                                                                // [
                                                                                // [Function: firstListener],
                                                                                // [Function: secondListener],
                                                                                // [Function: thirdListener]
                                                                                // ]
                                                                                // Helloooo! first listener
                                                                                // event with parameters 1, 2 in second listener
                                                                                // event with parameters 1, 2, 3, 4, 5 in third listener +
                                                                                import { EventEmitter } from 'node:events';
                                                                                const myEmitter = new EventEmitter();

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

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

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

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

                                                                                Type Parameters

                                                                                • K

                                                                                Parameters

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

                                                                                Returns boolean

                                                                                v0.1.26

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

                                                                                -
                                                                                import { EventEmitter } from 'node:events';

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

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

                                                                                console.log(myEE.eventNames());
                                                                                // Prints: [ 'foo', 'bar', Symbol(symbol) ] +
                                                                                import { EventEmitter } from 'node:events';

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

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

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

                                                                                Returns (string | symbol)[]

                                                                                v6.0.0

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

                                                                                +set by emitter.setMaxListeners(n) or defaults to EventEmitter.defaultMaxListeners.

                                                                                Returns number

                                                                                v1.0.0

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

                                                                              • Optionallistener: Function

                                                                                The event handler function

                                                                              Returns number

                                                                              v3.2.0

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

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

                                                                                Type Parameters

                                                                                • K

                                                                                Parameters

                                                                                • eventName: string | symbol

                                                                                Returns Function[]

                                                                                v0.1.26

                                                                                @@ -89,7 +89,7 @@ listener is removed, and then invoked.

                                                                              Returns this

                                                                              v6.0.0

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

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

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

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

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

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

                                                                                // Logs "log persistently" twice
                                                                                newListeners[0]();
                                                                                emitter.emit('log'); +
                                                                                import { EventEmitter } from 'node:events';
                                                                                const emitter = new EventEmitter();
                                                                                emitter.once('log', () => console.log('log once'));

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

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

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

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

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

                                                                                Type Parameters

                                                                                • K

                                                                                Parameters

                                                                                • eventName: string | symbol

                                                                                Returns Function[]

                                                                                v9.4.0

                                                                                @@ -100,7 +100,7 @@ component or module (e.g. sockets or file streams).

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

                                                                                Parameters

                                                                                • OptionaleventName: string | symbol

                                                                                Returns this

                                                                                v0.1.26

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

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

                                                                                removeListener() will remove, at most, one instance of a listener from the @@ -110,7 +110,7 @@ called multiple times to remove each instance.

                                                                                Once an event is emitted, all listeners attached to it at the time of emitting are called in order. This implies that any removeListener() or removeAllListeners() calls after emitting and before the last listener finishes execution will not remove them fromemit() in progress. Subsequent events behave as expected.

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

                                                                                const callbackA = () => {
                                                                                console.log('A');
                                                                                myEmitter.removeListener('event', callbackB);
                                                                                };

                                                                                const callbackB = () => {
                                                                                console.log('B');
                                                                                };

                                                                                myEmitter.on('event', callbackA);

                                                                                myEmitter.on('event', callbackB);

                                                                                // callbackA removes listener callbackB but it will still be called.
                                                                                // Internal listener array at time of emit [callbackA, callbackB]
                                                                                myEmitter.emit('event');
                                                                                // Prints:
                                                                                // A
                                                                                // B

                                                                                // callbackB is now removed.
                                                                                // Internal listener array [callbackA]
                                                                                myEmitter.emit('event');
                                                                                // Prints:
                                                                                // A +
                                                                                import { EventEmitter } from 'node:events';
                                                                                class MyEmitter extends EventEmitter {}
                                                                                const myEmitter = new MyEmitter();

                                                                                const callbackA = () => {
                                                                                console.log('A');
                                                                                myEmitter.removeListener('event', callbackB);
                                                                                };

                                                                                const callbackB = () => {
                                                                                console.log('B');
                                                                                };

                                                                                myEmitter.on('event', callbackA);

                                                                                myEmitter.on('event', callbackB);

                                                                                // callbackA removes listener callbackB but it will still be called.
                                                                                // Internal listener array at time of emit [callbackA, callbackB]
                                                                                myEmitter.emit('event');
                                                                                // Prints:
                                                                                // A
                                                                                // B

                                                                                // callbackB is now removed.
                                                                                // Internal listener array [callbackA]
                                                                                myEmitter.emit('event');
                                                                                // Prints:
                                                                                // A

                                                                                Because listeners are managed using an internal array, calling this will @@ -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 3c14c2baa..d721d37df 100644 --- a/docs/interfaces/src.IWorkerChoiceStrategy.html +++ b/docs/interfaces/src.IWorkerChoiceStrategy.html @@ -1,5 +1,5 @@ -IWorkerChoiceStrategy | poolifier - v5.0.0
                                                                              poolifier - v5.0.0
                                                                                Preparing search index...

                                                                                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;
                                                                                }
                                                                                Index

                                                                                Properties

                                                                                choose +IWorkerChoiceStrategy | poolifier - v5.0.1
                                                                                poolifier - v5.0.1
                                                                                  Preparing search index...

                                                                                  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;
                                                                                  }
                                                                                  Index

                                                                                  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: number): 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: number): 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 5731bbc85..aaa2db589 100644 --- a/docs/interfaces/src.IWorkerNode.html +++ b/docs/interfaces/src.IWorkerNode.html @@ -1,7 +1,7 @@ -IWorkerNode | poolifier - v5.0.0
                                                                                  poolifier - v5.0.0
                                                                                    Preparing search index...

                                                                                    Interface IWorkerNode<Worker, Data>Internal

                                                                                    Worker node interface.

                                                                                    +IWorkerNode | poolifier - v5.0.1
                                                                                    poolifier - v5.0.1
                                                                                      Preparing search index...

                                                                                      Interface IWorkerNode<Worker, Data>Internal

                                                                                      Worker node interface.

                                                                                      interface IWorkerNode<Worker extends IWorker, Data = unknown> {
                                                                                          clearTasksQueue: () => void;
                                                                                          deleteTask: (task: Task<Data>) => boolean;
                                                                                          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;
                                                                                          tasksQueue: PriorityQueue<Task<Data>>;
                                                                                          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
                                                                                      Index

                                                                                      Properties

                                                                                      Hierarchy

                                                                                      • EventEmitter
                                                                                        • IWorkerNode
                                                                                      Index

                                                                                      Properties

                                                                                      clearTasksQueue: () => void

                                                                                      Clears tasks queue.

                                                                                      -
                                                                                      deleteTask: (task: Task<Data>) => boolean

                                                                                      Deletes a task from the tasks queue.

                                                                                      +
                                                                                      deleteTask: (task: Task<Data>) => boolean

                                                                                      Deletes a task from the tasks queue.

                                                                                      Type declaration

                                                                                        • (task: Task<Data>): boolean
                                                                                        • Parameters

                                                                                          Returns boolean

                                                                                          true if the task was deleted, false otherwise.

                                                                                          -
                                                                                      deleteTaskFunctionWorkerUsage: (name: string) => boolean

                                                                                      Deletes task function worker usage statistics.

                                                                                      +
                                                                                      deleteTaskFunctionWorkerUsage: (name: string) => boolean

                                                                                      Deletes task function worker usage statistics.

                                                                                      Type declaration

                                                                                        • (name: string): 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?: number): undefined | Task<Data>
                                                                                        • Parameters

                                                                                          • Optionalbucket: number

                                                                                            The prioritized bucket to dequeue from.

                                                                                          Returns undefined | Task<Data>

                                                                                          The dequeued task.

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

                                                                                      Enqueue task.

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

                                                                                      Enqueue task.

                                                                                      Type declaration

                                                                                        • (task: Task<Data>): 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: string): 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

                                                                                      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

                                                                                      setTasksQueuePriority: (enablePriority: boolean) => void

                                                                                      Sets tasks queue priority.

                                                                                      +

                                                                                      Returns void

                                                                                      setTasksQueuePriority: (enablePriority: boolean) => void

                                                                                      Sets tasks queue priority.

                                                                                      Type declaration

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

                                                                                      -
                                                                                      tasksQueue: PriorityQueue<Task<Data>>

                                                                                      Tasks queue.

                                                                                      -
                                                                                      tasksQueueBackPressureSize: number

                                                                                      Tasks queue back pressure size. +

                                                                                      tasksQueue: PriorityQueue<Task<Data>>

                                                                                      Tasks queue.

                                                                                      +
                                                                                      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
                                                                                        • ...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
                                                                                        • ...args: AnyRest

                                                                                        Returns void

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

                                                                                        Type Parameters

                                                                                        • K

                                                                                        Parameters

                                                                                        • eventName: string | symbol
                                                                                        • listener: (...args: any[]) => 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.

                                                                                        Returns true if the event had listeners, false otherwise.

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

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

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

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

                                                                                        // Prints:
                                                                                        // [
                                                                                        // [Function: firstListener],
                                                                                        // [Function: secondListener],
                                                                                        // [Function: thirdListener]
                                                                                        // ]
                                                                                        // Helloooo! first listener
                                                                                        // event with parameters 1, 2 in second listener
                                                                                        // event with parameters 1, 2, 3, 4, 5 in third listener +
                                                                                        import { EventEmitter } from 'node:events';
                                                                                        const myEmitter = new EventEmitter();

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

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

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

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

                                                                                        Type Parameters

                                                                                        • K

                                                                                        Parameters

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

                                                                                        Returns boolean

                                                                                        v0.1.26

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

                                                                                        -
                                                                                        import { EventEmitter } from 'node:events';

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

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

                                                                                        console.log(myEE.eventNames());
                                                                                        // Prints: [ 'foo', 'bar', Symbol(symbol) ] +
                                                                                        import { EventEmitter } from 'node:events';

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

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

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

                                                                                        Returns (string | symbol)[]

                                                                                        v6.0.0

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

                                                                                        +set by emitter.setMaxListeners(n) or defaults to EventEmitter.defaultMaxListeners.

                                                                                        Returns number

                                                                                        v1.0.0

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

                                                                                      • Optionallistener: Function

                                                                                        The event handler function

                                                                                      Returns number

                                                                                      v3.2.0

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

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

                                                                                        Type Parameters

                                                                                        • K

                                                                                        Parameters

                                                                                        • eventName: string | symbol

                                                                                        Returns Function[]

                                                                                        v0.1.26

                                                                                        @@ -118,7 +118,7 @@ been added. Multiple calls passing the same combination of eventNameReturns a reference to the EventEmitter, so that calls can be chained.

                                                                                        By default, event listeners are invoked in the order they are added. The emitter.prependListener() method can be used as an alternative to add the event listener to the beginning of the listeners array.

                                                                                        -
                                                                                        import { EventEmitter } from 'node:events';
                                                                                        const myEE = new EventEmitter();
                                                                                        myEE.on('foo', () => console.log('a'));
                                                                                        myEE.prependListener('foo', () => console.log('b'));
                                                                                        myEE.emit('foo');
                                                                                        // Prints:
                                                                                        // b
                                                                                        // a +
                                                                                        import { EventEmitter } from 'node:events';
                                                                                        const myEE = new EventEmitter();
                                                                                        myEE.on('foo', () => console.log('a'));
                                                                                        myEE.prependListener('foo', () => console.log('b'));
                                                                                        myEE.emit('foo');
                                                                                        // Prints:
                                                                                        // b
                                                                                        // a

                                                                                        Type Parameters

                                                                                        • K

                                                                                        Parameters

                                                                                        • eventName: string | symbol

                                                                                          The name of the event.

                                                                                          @@ -132,7 +132,7 @@ next time eventName is triggered, this listener is removed and then

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

                                                                                          By default, event listeners are invoked in the order they are added. The emitter.prependOnceListener() method can be used as an alternative to add the event listener to the beginning of the listeners array.

                                                                                          -
                                                                                          import { EventEmitter } from 'node:events';
                                                                                          const myEE = new EventEmitter();
                                                                                          myEE.once('foo', () => console.log('a'));
                                                                                          myEE.prependOnceListener('foo', () => console.log('b'));
                                                                                          myEE.emit('foo');
                                                                                          // Prints:
                                                                                          // b
                                                                                          // a +
                                                                                          import { EventEmitter } from 'node:events';
                                                                                          const myEE = new EventEmitter();
                                                                                          myEE.once('foo', () => console.log('a'));
                                                                                          myEE.prependOnceListener('foo', () => console.log('b'));
                                                                                          myEE.emit('foo');
                                                                                          // Prints:
                                                                                          // b
                                                                                          // a

                                                                                          Type Parameters

                                                                                          • K

                                                                                          Parameters

                                                                                          • eventName: string | symbol

                                                                                            The name of the event.

                                                                                            @@ -160,7 +160,7 @@ listener is removed, and then invoked.

                                                                                          Returns this

                                                                                          v6.0.0

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

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

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

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

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

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

                                                                                        // Logs "log persistently" twice
                                                                                        newListeners[0]();
                                                                                        emitter.emit('log'); +
                                                                                        import { EventEmitter } from 'node:events';
                                                                                        const emitter = new EventEmitter();
                                                                                        emitter.once('log', () => console.log('log once'));

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

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

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

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

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

                                                                                        Type Parameters

                                                                                        • K

                                                                                        Parameters

                                                                                        • eventName: string | symbol

                                                                                        Returns Function[]

                                                                                        v9.4.0

                                                                                        @@ -171,7 +171,7 @@ component or module (e.g. sockets or file streams).

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

                                                                                        Parameters

                                                                                        • OptionaleventName: string | symbol

                                                                                        Returns this

                                                                                        v0.1.26

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

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

                                                                                        removeListener() will remove, at most, one instance of a listener from the @@ -181,7 +181,7 @@ called multiple times to remove each instance.

                                                                                        Once an event is emitted, all listeners attached to it at the time of emitting are called in order. This implies that any removeListener() or removeAllListeners() calls after emitting and before the last listener finishes execution will not remove them fromemit() in progress. Subsequent events behave as expected.

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

                                                                                        const callbackA = () => {
                                                                                        console.log('A');
                                                                                        myEmitter.removeListener('event', callbackB);
                                                                                        };

                                                                                        const callbackB = () => {
                                                                                        console.log('B');
                                                                                        };

                                                                                        myEmitter.on('event', callbackA);

                                                                                        myEmitter.on('event', callbackB);

                                                                                        // callbackA removes listener callbackB but it will still be called.
                                                                                        // Internal listener array at time of emit [callbackA, callbackB]
                                                                                        myEmitter.emit('event');
                                                                                        // Prints:
                                                                                        // A
                                                                                        // B

                                                                                        // callbackB is now removed.
                                                                                        // Internal listener array [callbackA]
                                                                                        myEmitter.emit('event');
                                                                                        // Prints:
                                                                                        // A +
                                                                                        import { EventEmitter } from 'node:events';
                                                                                        class MyEmitter extends EventEmitter {}
                                                                                        const myEmitter = new MyEmitter();

                                                                                        const callbackA = () => {
                                                                                        console.log('A');
                                                                                        myEmitter.removeListener('event', callbackB);
                                                                                        };

                                                                                        const callbackB = () => {
                                                                                        console.log('B');
                                                                                        };

                                                                                        myEmitter.on('event', callbackA);

                                                                                        myEmitter.on('event', callbackB);

                                                                                        // callbackA removes listener callbackB but it will still be called.
                                                                                        // Internal listener array at time of emit [callbackA, callbackB]
                                                                                        myEmitter.emit('event');
                                                                                        // Prints:
                                                                                        // A
                                                                                        // B

                                                                                        // callbackB is now removed.
                                                                                        // Internal listener array [callbackA]
                                                                                        myEmitter.emit('event');
                                                                                        // Prints:
                                                                                        // A

                                                                                        Because listeners are managed using an internal array, calling this will @@ -203,4 +203,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 1265a3a19..b413968fd 100644 --- a/docs/interfaces/src.MeasurementOptions.html +++ b/docs/interfaces/src.MeasurementOptions.html @@ -1,4 +1,4 @@ -MeasurementOptions | poolifier - v5.0.0
                                                                                      poolifier - v5.0.0
                                                                                        Preparing search index...

                                                                                        Interface MeasurementOptions

                                                                                        Measurement options.

                                                                                        -
                                                                                        interface MeasurementOptions {
                                                                                            median: boolean;
                                                                                        }
                                                                                        Index

                                                                                        Properties

                                                                                        median +MeasurementOptions | poolifier - v5.0.1
                                                                                        poolifier - v5.0.1
                                                                                          Preparing search index...

                                                                                          Interface MeasurementOptions

                                                                                          Measurement options.

                                                                                          +
                                                                                          interface MeasurementOptions {
                                                                                              median: boolean;
                                                                                          }
                                                                                          Index

                                                                                          Properties

                                                                                          Properties

                                                                                          median: boolean

                                                                                          Set measurement median.

                                                                                          -
                                                                                          +
                                                                                          diff --git a/docs/interfaces/src.MeasurementStatistics.html b/docs/interfaces/src.MeasurementStatistics.html index e93867f81..c8b7389ef 100644 --- a/docs/interfaces/src.MeasurementStatistics.html +++ b/docs/interfaces/src.MeasurementStatistics.html @@ -1,14 +1,14 @@ -MeasurementStatistics | poolifier - v5.0.0
                                                                                          poolifier - v5.0.0
                                                                                            Preparing search index...

                                                                                            Interface MeasurementStatisticsInternal

                                                                                            Measurement statistics.

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

                                                                                            Properties

                                                                                            aggregate? +MeasurementStatistics | poolifier - v5.0.1
                                                                                            poolifier - v5.0.1
                                                                                              Preparing search index...

                                                                                              Interface MeasurementStatisticsInternal

                                                                                              Measurement statistics.

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

                                                                                              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 c57d8480d..4de096563 100644 --- a/docs/interfaces/src.MeasurementStatisticsRequirements.html +++ b/docs/interfaces/src.MeasurementStatisticsRequirements.html @@ -1,8 +1,8 @@ -MeasurementStatisticsRequirements | poolifier - v5.0.0
                                                                                              poolifier - v5.0.0
                                                                                                Preparing search index...

                                                                                                Interface MeasurementStatisticsRequirementsInternal

                                                                                                Measurement statistics requirements.

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

                                                                                                Properties

                                                                                                aggregate +MeasurementStatisticsRequirements | poolifier - v5.0.1
                                                                                                poolifier - v5.0.1
                                                                                                  Preparing search index...

                                                                                                  Interface MeasurementStatisticsRequirementsInternal

                                                                                                  Measurement statistics requirements.

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

                                                                                                  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 e789f9aad..12744e4e5 100644 --- a/docs/interfaces/src.MessageValue.html +++ b/docs/interfaces/src.MessageValue.html @@ -1,7 +1,7 @@ -MessageValue | poolifier - v5.0.0
                                                                                                  poolifier - v5.0.0
                                                                                                    Preparing search index...

                                                                                                    Interface MessageValue<Data, ErrorData>Internal

                                                                                                    Message object that is passed between main worker and worker.

                                                                                                    +MessageValue | poolifier - v5.0.1
                                                                                                    poolifier - v5.0.1
                                                                                                      Preparing search index...

                                                                                                      Interface MessageValue<Data, ErrorData>Internal

                                                                                                      Message object that is passed between main worker and worker.

                                                                                                      interface MessageValue<Data = unknown, ErrorData = unknown> {
                                                                                                          abortable?: boolean;
                                                                                                          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}`;
                                                                                                          taskOperation?: "abort";
                                                                                                          taskPerformance?: TaskPerformance;
                                                                                                          timestamp?: number;
                                                                                                          transferList?: readonly Transferable[];
                                                                                                          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 Summary)

                                                                                                      Index

                                                                                                      Properties

                                                                                                      Hierarchy (View Summary)

                                                                                                      Index

                                                                                                      Properties

                                                                                                      Properties

                                                                                                      abortable?: boolean

                                                                                                      Whether the task is abortable or not.

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

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

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

                                                                                                      -
                                                                                                      taskOperation?: "abort"

                                                                                                      Task operation:

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

                                                                                                      +
                                                                                                      taskOperation?: "abort"

                                                                                                      Task operation:

                                                                                                      • 'abort' - Abort a task.
                                                                                                      -
                                                                                                      taskPerformance?: TaskPerformance

                                                                                                      Task performance.

                                                                                                      -
                                                                                                      timestamp?: number

                                                                                                      Timestamp.

                                                                                                      -
                                                                                                      transferList?: readonly Transferable[]

                                                                                                      Array of transferable objects.

                                                                                                      -
                                                                                                      workerError?: WorkerError<ErrorData>

                                                                                                      Worker error.

                                                                                                      -
                                                                                                      workerId?: number

                                                                                                      Worker id.

                                                                                                      -
                                                                                                      +
                                                                                                      taskPerformance?: TaskPerformance

                                                                                                      Task performance.

                                                                                                      +
                                                                                                      timestamp?: number

                                                                                                      Timestamp.

                                                                                                      +
                                                                                                      transferList?: readonly Transferable[]

                                                                                                      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 de38f8465..5338ec689 100644 --- a/docs/interfaces/src.PoolInfo.html +++ b/docs/interfaces/src.PoolInfo.html @@ -1,5 +1,5 @@ -PoolInfo | poolifier - v5.0.0
                                                                                                      poolifier - v5.0.0
                                                                                                        Preparing search index...

                                                                                                        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;
                                                                                                        }
                                                                                                        Index

                                                                                                        Properties

                                                                                                        backPressure? +PoolInfo | poolifier - v5.0.1
                                                                                                        poolifier - v5.0.1
                                                                                                          Preparing search index...

                                                                                                          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;
                                                                                                          }
                                                                                                          Index

                                                                                                          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 6d0cfb1d8..ef116847c 100644 --- a/docs/interfaces/src.PoolOptions.html +++ b/docs/interfaces/src.PoolOptions.html @@ -1,6 +1,6 @@ -PoolOptions | poolifier - v5.0.0
                                                                                                          poolifier - v5.0.0
                                                                                                            Preparing search index...

                                                                                                            Interface PoolOptions<Worker>

                                                                                                            Options for a poolifier pool.

                                                                                                            +PoolOptions | poolifier - v5.0.1
                                                                                                            poolifier - v5.0.1
                                                                                                              Preparing search index...

                                                                                                              Interface PoolOptions<Worker>

                                                                                                              Options for a poolifier pool.

                                                                                                              interface PoolOptions<Worker extends IWorker> {
                                                                                                                  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.

                                                                                                                -
                                                                                                              Index

                                                                                                              Properties

                                                                                                              Index

                                                                                                              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.PriorityQueue.html b/docs/interfaces/src.PriorityQueue.html index 7ef9652c2..2656d8040 100644 --- a/docs/interfaces/src.PriorityQueue.html +++ b/docs/interfaces/src.PriorityQueue.html @@ -1,6 +1,6 @@ -PriorityQueue | poolifier - v5.0.0
                                                                                                              poolifier - v5.0.0
                                                                                                                Preparing search index...

                                                                                                                Interface PriorityQueue<T>Internal

                                                                                                                Priority queue.

                                                                                                                +PriorityQueue | poolifier - v5.0.1
                                                                                                                poolifier - v5.0.1
                                                                                                                  Preparing search index...

                                                                                                                  Interface PriorityQueue<T>Internal

                                                                                                                  Priority queue.

                                                                                                                  interface PriorityQueue<T> {
                                                                                                                      maxSize: number;
                                                                                                                      get buckets(): number;
                                                                                                                      get enablePriority(): boolean;
                                                                                                                      set enablePriority(enablePriority: boolean): void;
                                                                                                                      get size(): number;
                                                                                                                      "[iterator]"(): Iterator<T>;
                                                                                                                      clear(): void;
                                                                                                                      delete(data: T): boolean;
                                                                                                                      dequeue(bucket?: number): undefined | T;
                                                                                                                      enqueue(data: T, priority?: number): number;
                                                                                                                  }

                                                                                                                  Type Parameters

                                                                                                                  • T

                                                                                                                    Type of priority queue data.

                                                                                                                    -
                                                                                                                  Index

                                                                                                                  Properties

                                                                                                                  Index

                                                                                                                  Properties

                                                                                                                  Accessors

                                                                                                                  Properties

                                                                                                                  maxSize: number

                                                                                                                  The priority queue maximum size.

                                                                                                                  -

                                                                                                                  Accessors

                                                                                                                  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

                                                                                                                  • Deletes the given data from the priority queue.

                                                                                                                    Parameters

                                                                                                                    • data: T

                                                                                                                      Data to delete.

                                                                                                                    Returns boolean

                                                                                                                    true if the data was deleted, false otherwise.

                                                                                                                    -
                                                                                                                  • 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/interfaces/src.PromiseResponseWrapper.html b/docs/interfaces/src.PromiseResponseWrapper.html index 3f680944b..19ef6eb8b 100644 --- a/docs/interfaces/src.PromiseResponseWrapper.html +++ b/docs/interfaces/src.PromiseResponseWrapper.html @@ -1,13 +1,13 @@ -PromiseResponseWrapper | poolifier - v5.0.0
                                                                                                                  poolifier - v5.0.0
                                                                                                                    Preparing search index...

                                                                                                                    Interface PromiseResponseWrapper<Response>Internal

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

                                                                                                                    +PromiseResponseWrapper | poolifier - v5.0.1
                                                                                                                    poolifier - v5.0.1
                                                                                                                      Preparing search index...

                                                                                                                      Interface PromiseResponseWrapper<Response>Internal

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

                                                                                                                      interface PromiseResponseWrapper<Response = unknown> {
                                                                                                                          abortSignal?: AbortSignal;
                                                                                                                          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.

                                                                                                                        -
                                                                                                                      Index

                                                                                                                      Properties

                                                                                                                      Index

                                                                                                                      Properties

                                                                                                                      abortSignal?: AbortSignal

                                                                                                                      The task abort signal.

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

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

                                                                                                                      +
                                                                                                                      diff --git a/docs/interfaces/src.StrategyData.html b/docs/interfaces/src.StrategyData.html index d42450882..42257fea7 100644 --- a/docs/interfaces/src.StrategyData.html +++ b/docs/interfaces/src.StrategyData.html @@ -1,3 +1,3 @@ -StrategyData | poolifier - v5.0.0
                                                                                                                      poolifier - v5.0.0
                                                                                                                        Preparing search index...

                                                                                                                        Interface StrategyDataInternal

                                                                                                                        Worker choice strategy data.

                                                                                                                        -
                                                                                                                        interface StrategyData {
                                                                                                                            virtualTaskEndTimestamp?: number;
                                                                                                                        }
                                                                                                                        Index

                                                                                                                        Properties

                                                                                                                        virtualTaskEndTimestamp?: number
                                                                                                                        +StrategyData | poolifier - v5.0.1
                                                                                                                        poolifier - v5.0.1
                                                                                                                          Preparing search index...

                                                                                                                          Interface StrategyDataInternal

                                                                                                                          Worker choice strategy data.

                                                                                                                          +
                                                                                                                          interface StrategyData {
                                                                                                                              virtualTaskEndTimestamp?: number;
                                                                                                                          }
                                                                                                                          Index

                                                                                                                          Properties

                                                                                                                          virtualTaskEndTimestamp?: number
                                                                                                                          diff --git a/docs/interfaces/src.StrategyPolicy.html b/docs/interfaces/src.StrategyPolicy.html index 6ab35e173..159384d1b 100644 --- a/docs/interfaces/src.StrategyPolicy.html +++ b/docs/interfaces/src.StrategyPolicy.html @@ -1,6 +1,6 @@ -StrategyPolicy | poolifier - v5.0.0
                                                                                                                          poolifier - v5.0.0
                                                                                                                            Preparing search index...

                                                                                                                            Interface StrategyPolicyInternal

                                                                                                                            Strategy policy.

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

                                                                                                                            Properties

                                                                                                                            dynamicWorkerReady +StrategyPolicy | poolifier - v5.0.1
                                                                                                                            poolifier - v5.0.1
                                                                                                                              Preparing search index...

                                                                                                                              Interface StrategyPolicyInternal

                                                                                                                              Strategy policy.

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

                                                                                                                              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 76bc3624f..d2a65f7bd 100644 --- a/docs/interfaces/src.Task.html +++ b/docs/interfaces/src.Task.html @@ -1,6 +1,6 @@ -Task | poolifier - v5.0.0
                                                                                                                              poolifier - v5.0.0
                                                                                                                                Preparing search index...

                                                                                                                                Interface Task<Data>Internal

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

                                                                                                                                +Task | poolifier - v5.0.1
                                                                                                                                poolifier - v5.0.1
                                                                                                                                  Preparing search index...

                                                                                                                                  Interface Task<Data>Internal

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

                                                                                                                                  interface Task<Data = unknown> {
                                                                                                                                      abortable?: boolean;
                                                                                                                                      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 Transferable[];
                                                                                                                                  }

                                                                                                                                  Type Parameters

                                                                                                                                  • Data = unknown

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

                                                                                                                                    -

                                                                                                                                  Hierarchy (View Summary)

                                                                                                                                  Index

                                                                                                                                  Properties

                                                                                                                                  Hierarchy (View Summary)

                                                                                                                                  Index

                                                                                                                                  Properties

                                                                                                                                  abortable?: boolean

                                                                                                                                  Whether the task is abortable or not.

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

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

                                                                                                                                  +
                                                                                                                                  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 Transferable[]

                                                                                                                                  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 Transferable[]

                                                                                                                                  Array of transferable objects.

                                                                                                                                  +
                                                                                                                                  diff --git a/docs/interfaces/src.TaskFunctionObject.html b/docs/interfaces/src.TaskFunctionObject.html index be8d619f4..b7f43b5fa 100644 --- a/docs/interfaces/src.TaskFunctionObject.html +++ b/docs/interfaces/src.TaskFunctionObject.html @@ -1,10 +1,10 @@ -TaskFunctionObject | poolifier - v5.0.0
                                                                                                                                  poolifier - v5.0.0
                                                                                                                                    Preparing search index...

                                                                                                                                    Interface TaskFunctionObject<Data, Response>

                                                                                                                                    Task function object.

                                                                                                                                    +TaskFunctionObject | poolifier - v5.0.1
                                                                                                                                    poolifier - v5.0.1
                                                                                                                                      Preparing search index...

                                                                                                                                      Interface TaskFunctionObject<Data, Response>

                                                                                                                                      Task function object.

                                                                                                                                      interface TaskFunctionObject<Data = unknown, Response = unknown> {
                                                                                                                                          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.

                                                                                                                                        -
                                                                                                                                      Index

                                                                                                                                      Properties

                                                                                                                                      Index

                                                                                                                                      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 41317ac47..3551da7a9 100644 --- a/docs/interfaces/src.TaskFunctionOperationResult.html +++ b/docs/interfaces/src.TaskFunctionOperationResult.html @@ -1,4 +1,4 @@ -TaskFunctionOperationResult | poolifier - v5.0.0
                                                                                                                                      poolifier - v5.0.0
                                                                                                                                        Preparing search index...

                                                                                                                                        Interface TaskFunctionOperationResult

                                                                                                                                        Task function operation result.

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

                                                                                                                                        Properties

                                                                                                                                        error? +TaskFunctionOperationResult | poolifier - v5.0.1
                                                                                                                                        poolifier - v5.0.1
                                                                                                                                          Preparing search index...

                                                                                                                                          Interface TaskFunctionOperationResult

                                                                                                                                          Task function operation result.

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

                                                                                                                                          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 f1b6968f6..237151573 100644 --- a/docs/interfaces/src.TaskFunctionProperties.html +++ b/docs/interfaces/src.TaskFunctionProperties.html @@ -1,8 +1,8 @@ -TaskFunctionProperties | poolifier - v5.0.0
                                                                                                                                          poolifier - v5.0.0
                                                                                                                                            Preparing search index...

                                                                                                                                            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";
                                                                                                                                            }
                                                                                                                                            Index

                                                                                                                                            Properties

                                                                                                                                            name +TaskFunctionProperties | poolifier - v5.0.1
                                                                                                                                            poolifier - v5.0.1
                                                                                                                                              Preparing search index...

                                                                                                                                              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";
                                                                                                                                              }
                                                                                                                                              Index

                                                                                                                                              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 d2a670e0d..e5213adbd 100644 --- a/docs/interfaces/src.TaskPerformance.html +++ b/docs/interfaces/src.TaskPerformance.html @@ -1,10 +1,10 @@ -TaskPerformance | poolifier - v5.0.0
                                                                                                                                              poolifier - v5.0.0
                                                                                                                                                Preparing search index...

                                                                                                                                                Interface TaskPerformanceInternal

                                                                                                                                                Task performance.

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

                                                                                                                                                Properties

                                                                                                                                                elu? +TaskPerformance | poolifier - v5.0.1
                                                                                                                                                poolifier - v5.0.1
                                                                                                                                                  Preparing search index...

                                                                                                                                                  Interface TaskPerformanceInternal

                                                                                                                                                  Task performance.

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

                                                                                                                                                  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 233a3f248..3ebd54119 100644 --- a/docs/interfaces/src.TaskStatistics.html +++ b/docs/interfaces/src.TaskStatistics.html @@ -1,5 +1,5 @@ -TaskStatistics | poolifier - v5.0.0
                                                                                                                                                  poolifier - v5.0.0
                                                                                                                                                    Preparing search index...

                                                                                                                                                    Interface TaskStatisticsInternal

                                                                                                                                                    Task statistics.

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

                                                                                                                                                    Properties

                                                                                                                                                    executed +TaskStatistics | poolifier - v5.0.1
                                                                                                                                                    poolifier - v5.0.1
                                                                                                                                                      Preparing search index...

                                                                                                                                                      Interface TaskStatisticsInternal

                                                                                                                                                      Task statistics.

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

                                                                                                                                                      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 94eeea499..6b2d87d9b 100644 --- a/docs/interfaces/src.TaskStatisticsRequirements.html +++ b/docs/interfaces/src.TaskStatisticsRequirements.html @@ -1,8 +1,8 @@ -TaskStatisticsRequirements | poolifier - v5.0.0
                                                                                                                                                      poolifier - v5.0.0
                                                                                                                                                        Preparing search index...

                                                                                                                                                        Interface TaskStatisticsRequirementsInternal

                                                                                                                                                        Pool worker node worker usage statistics requirements.

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

                                                                                                                                                        Properties

                                                                                                                                                        elu +TaskStatisticsRequirements | poolifier - v5.0.1
                                                                                                                                                        poolifier - v5.0.1
                                                                                                                                                          Preparing search index...

                                                                                                                                                          Interface TaskStatisticsRequirementsInternal

                                                                                                                                                          Pool worker node worker usage statistics requirements.

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

                                                                                                                                                          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 c1d055a34..114d4ff0f 100644 --- a/docs/interfaces/src.TasksQueueOptions.html +++ b/docs/interfaces/src.TasksQueueOptions.html @@ -1,32 +1,32 @@ -TasksQueueOptions | poolifier - v5.0.0
                                                                                                                                                          poolifier - v5.0.0
                                                                                                                                                            Preparing search index...

                                                                                                                                                            Interface TasksQueueOptions

                                                                                                                                                            Worker node tasks queue options.

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

                                                                                                                                                            Properties

                                                                                                                                                            concurrency? +TasksQueueOptions | poolifier - v5.0.1
                                                                                                                                                            poolifier - v5.0.1
                                                                                                                                                              Preparing search index...

                                                                                                                                                              Interface TasksQueueOptions

                                                                                                                                                              Worker node tasks queue options.

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

                                                                                                                                                              Properties

                                                                                                                                                              concurrency?: number

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

                                                                                                                                                              -
                                                                                                                                                              1
                                                                                                                                                              +
                                                                                                                                                              1
                                                                                                                                                               
                                                                                                                                                              -
                                                                                                                                                              size?: number

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

                                                                                                                                                              -
                                                                                                                                                              (pool maximum size)^2
                                                                                                                                                              +
                                                                                                                                                              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.

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

                                                                                                                                                              -
                                                                                                                                                              0.6
                                                                                                                                                              +
                                                                                                                                                              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.WorkerChoiceStrategiesContext.html b/docs/interfaces/src.WorkerChoiceStrategiesContext.html index c4806c6a0..239699d35 100644 --- a/docs/interfaces/src.WorkerChoiceStrategiesContext.html +++ b/docs/interfaces/src.WorkerChoiceStrategiesContext.html @@ -1,8 +1,8 @@ -WorkerChoiceStrategiesContext | poolifier - v5.0.0
                                                                                                                                                              poolifier - v5.0.0
                                                                                                                                                                Preparing search index...

                                                                                                                                                                Interface WorkerChoiceStrategiesContext<Worker, Data, Response>Internal

                                                                                                                                                                The worker choice strategies context.

                                                                                                                                                                +WorkerChoiceStrategiesContext | poolifier - v5.0.1
                                                                                                                                                                poolifier - v5.0.1
                                                                                                                                                                  Preparing search index...

                                                                                                                                                                  Interface WorkerChoiceStrategiesContext<Worker, Data, Response>Internal

                                                                                                                                                                  The worker choice strategies context.

                                                                                                                                                                  interface WorkerChoiceStrategiesContext<
                                                                                                                                                                      Worker extends IWorker,
                                                                                                                                                                      Data = unknown,
                                                                                                                                                                      Response = unknown,
                                                                                                                                                                  > {
                                                                                                                                                                      retriesCount: number;
                                                                                                                                                                      execute(
                                                                                                                                                                          workerChoiceStrategy?:
                                                                                                                                                                              | "FAIR_SHARE"
                                                                                                                                                                              | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                                              | "LEAST_BUSY"
                                                                                                                                                                              | "LEAST_ELU"
                                                                                                                                                                              | "LEAST_USED"
                                                                                                                                                                              | "ROUND_ROBIN"
                                                                                                                                                                              | "WEIGHTED_ROUND_ROBIN",
                                                                                                                                                                      ): number;
                                                                                                                                                                      getPolicy(): StrategyPolicy;
                                                                                                                                                                      getTaskStatisticsRequirements(): TaskStatisticsRequirements;
                                                                                                                                                                      remove(workerNodeKey: number): boolean;
                                                                                                                                                                      setDefaultWorkerChoiceStrategy(
                                                                                                                                                                          workerChoiceStrategy:
                                                                                                                                                                              | "FAIR_SHARE"
                                                                                                                                                                              | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                                              | "LEAST_BUSY"
                                                                                                                                                                              | "LEAST_ELU"
                                                                                                                                                                              | "LEAST_USED"
                                                                                                                                                                              | "ROUND_ROBIN"
                                                                                                                                                                              | "WEIGHTED_ROUND_ROBIN",
                                                                                                                                                                          opts?: WorkerChoiceStrategyOptions,
                                                                                                                                                                      ): void;
                                                                                                                                                                      setOptions(opts: undefined | WorkerChoiceStrategyOptions): void;
                                                                                                                                                                      syncWorkerChoiceStrategies(
                                                                                                                                                                          workerChoiceStrategies: Set<
                                                                                                                                                                              | "FAIR_SHARE"
                                                                                                                                                                              | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
                                                                                                                                                                              | "LEAST_BUSY"
                                                                                                                                                                              | "LEAST_ELU"
                                                                                                                                                                              | "LEAST_USED"
                                                                                                                                                                              | "ROUND_ROBIN"
                                                                                                                                                                              | "WEIGHTED_ROUND_ROBIN",
                                                                                                                                                                          >,
                                                                                                                                                                          opts?: WorkerChoiceStrategyOptions,
                                                                                                                                                                      ): void;
                                                                                                                                                                      update(workerNodeKey: number): boolean;
                                                                                                                                                                  }

                                                                                                                                                                  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.

                                                                                                                                                                    -
                                                                                                                                                                  Index

                                                                                                                                                                  Properties

                                                                                                                                                                  Index

                                                                                                                                                                  Properties

                                                                                                                                                                  retriesCount: number

                                                                                                                                                                  The number of worker choice strategies execution retries.

                                                                                                                                                                  -

                                                                                                                                                                  Methods

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

                                                                                                                                                                    +

                                                                                                                                                                  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.

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

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

                                                                                                                                                                  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/interfaces/src.WorkerChoiceStrategyOptions.html b/docs/interfaces/src.WorkerChoiceStrategyOptions.html index 80a25b392..b8b28f8ba 100644 --- a/docs/interfaces/src.WorkerChoiceStrategyOptions.html +++ b/docs/interfaces/src.WorkerChoiceStrategyOptions.html @@ -1,5 +1,5 @@ -WorkerChoiceStrategyOptions | poolifier - v5.0.0
                                                                                                                                                                  poolifier - v5.0.0
                                                                                                                                                                    Preparing search index...

                                                                                                                                                                    Interface WorkerChoiceStrategyOptions

                                                                                                                                                                    Worker choice strategy options.

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

                                                                                                                                                                    Properties

                                                                                                                                                                    elu? +WorkerChoiceStrategyOptions | poolifier - v5.0.1
                                                                                                                                                                    poolifier - v5.0.1
                                                                                                                                                                      Preparing search index...

                                                                                                                                                                      Interface WorkerChoiceStrategyOptions

                                                                                                                                                                      Worker choice strategy options.

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

                                                                                                                                                                      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 f0792870b..fc1dbe781 100644 --- a/docs/interfaces/src.WorkerError.html +++ b/docs/interfaces/src.WorkerError.html @@ -1,15 +1,15 @@ -WorkerError | poolifier - v5.0.0
                                                                                                                                                                      poolifier - v5.0.0
                                                                                                                                                                        Preparing search index...

                                                                                                                                                                        Interface WorkerError<Data>

                                                                                                                                                                        Worker error.

                                                                                                                                                                        +WorkerError | poolifier - v5.0.1
                                                                                                                                                                        poolifier - v5.0.1
                                                                                                                                                                          Preparing search index...

                                                                                                                                                                          Interface WorkerError<Data>

                                                                                                                                                                          Worker error.

                                                                                                                                                                          interface WorkerError<Data = unknown> {
                                                                                                                                                                              aborted: boolean;
                                                                                                                                                                              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.

                                                                                                                                                                            -
                                                                                                                                                                          Index

                                                                                                                                                                          Properties

                                                                                                                                                                          Index

                                                                                                                                                                          Properties

                                                                                                                                                                          aborted: boolean

                                                                                                                                                                          Whether the error is an abort error or not.

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

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

                                                                                                                                                                          +
                                                                                                                                                                          diff --git a/docs/interfaces/src.WorkerInfo.html b/docs/interfaces/src.WorkerInfo.html index 4a5c2f8dd..ce69ec9e6 100644 --- a/docs/interfaces/src.WorkerInfo.html +++ b/docs/interfaces/src.WorkerInfo.html @@ -1,5 +1,5 @@ -WorkerInfo | poolifier - v5.0.0
                                                                                                                                                                          poolifier - v5.0.0
                                                                                                                                                                            Preparing search index...

                                                                                                                                                                            Interface WorkerInfoInternal

                                                                                                                                                                            Worker information.

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

                                                                                                                                                                            Properties

                                                                                                                                                                            backPressure +WorkerInfo | poolifier - v5.0.1
                                                                                                                                                                            poolifier - v5.0.1
                                                                                                                                                                              Preparing search index...

                                                                                                                                                                              Interface WorkerInfoInternal

                                                                                                                                                                              Worker information.

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

                                                                                                                                                                              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.

                                                                                                                                                                              -
                                                                                                                                                                              queuedTaskAbortion: boolean

                                                                                                                                                                              Queued task abortion flag. +

                                                                                                                                                                              dynamic: boolean

                                                                                                                                                                              Dynamic flag.

                                                                                                                                                                              +
                                                                                                                                                                              id: undefined | number

                                                                                                                                                                              Worker id.

                                                                                                                                                                              +
                                                                                                                                                                              queuedTaskAbortion: boolean

                                                                                                                                                                              Queued task abortion flag. This flag is set to true when worker node is aborting a queued task.

                                                                                                                                                                              -
                                                                                                                                                                              ready: boolean

                                                                                                                                                                              Ready flag.

                                                                                                                                                                              -
                                                                                                                                                                              stealing: boolean

                                                                                                                                                                              Stealing flag. +

                                                                                                                                                                              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 d1e4cfe9e..5c3efd565 100644 --- a/docs/interfaces/src.WorkerNodeEventDetail.html +++ b/docs/interfaces/src.WorkerNodeEventDetail.html @@ -1,5 +1,5 @@ -WorkerNodeEventDetail | poolifier - v5.0.0
                                                                                                                                                                              poolifier - v5.0.0
                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                Interface WorkerNodeEventDetailInternal

                                                                                                                                                                                Worker node event detail.

                                                                                                                                                                                -
                                                                                                                                                                                interface WorkerNodeEventDetail {
                                                                                                                                                                                    taskId?: `${string}-${string}-${string}-${string}-${string}`;
                                                                                                                                                                                    workerId?: number;
                                                                                                                                                                                    workerNodeKey?: number;
                                                                                                                                                                                }
                                                                                                                                                                                Index

                                                                                                                                                                                Properties

                                                                                                                                                                                taskId? +WorkerNodeEventDetail | poolifier - v5.0.1
                                                                                                                                                                                poolifier - v5.0.1
                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                  Interface WorkerNodeEventDetailInternal

                                                                                                                                                                                  Worker node event detail.

                                                                                                                                                                                  +
                                                                                                                                                                                  interface WorkerNodeEventDetail {
                                                                                                                                                                                      taskId?: `${string}-${string}-${string}-${string}-${string}`;
                                                                                                                                                                                      workerId?: number;
                                                                                                                                                                                      workerNodeKey?: number;
                                                                                                                                                                                  }
                                                                                                                                                                                  Index

                                                                                                                                                                                  Properties

                                                                                                                                                                                  taskId?: `${string}-${string}-${string}-${string}-${string}`
                                                                                                                                                                                  workerId?: number
                                                                                                                                                                                  workerNodeKey?: number
                                                                                                                                                                                  +

                                                                                                                                                                                  Properties

                                                                                                                                                                                  taskId?: `${string}-${string}-${string}-${string}-${string}`
                                                                                                                                                                                  workerId?: number
                                                                                                                                                                                  workerNodeKey?: number
                                                                                                                                                                                  diff --git a/docs/interfaces/src.WorkerNodeOptions.html b/docs/interfaces/src.WorkerNodeOptions.html index 87574df15..39af7e473 100644 --- a/docs/interfaces/src.WorkerNodeOptions.html +++ b/docs/interfaces/src.WorkerNodeOptions.html @@ -1,7 +1,7 @@ -WorkerNodeOptions | poolifier - v5.0.0
                                                                                                                                                                                  poolifier - v5.0.0
                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                    Interface WorkerNodeOptionsInternal

                                                                                                                                                                                    Worker node options.

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

                                                                                                                                                                                    Properties

                                                                                                                                                                                    env? +WorkerNodeOptions | poolifier - v5.0.1
                                                                                                                                                                                    poolifier - v5.0.1
                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                      Interface WorkerNodeOptionsInternal

                                                                                                                                                                                      Worker node options.

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

                                                                                                                                                                                      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 035739731..32dd086a1 100644 --- a/docs/interfaces/src.WorkerOptions.html +++ b/docs/interfaces/src.WorkerOptions.html @@ -1,5 +1,5 @@ -WorkerOptions | poolifier - v5.0.0
                                                                                                                                                                                      poolifier - v5.0.0
                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                        Interface WorkerOptions

                                                                                                                                                                                        Options for workers.

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

                                                                                                                                                                                        Properties

                                                                                                                                                                                        killBehavior? +WorkerOptions | poolifier - v5.0.1
                                                                                                                                                                                        poolifier - v5.0.1
                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                          Interface WorkerOptions

                                                                                                                                                                                          Options for workers.

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

                                                                                                                                                                                          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.

                                                                                                                                                                                            @@ -21,7 +21,7 @@ The last active time of your worker will be updated when it terminates a task.
                                                                                                                                                                                          • If killBehavior is set to KillBehaviors.SOFT your tasks have no timeout and your workers will not be terminated until your task is completed.
                                                                                                                                                                                          -
                                                                                                                                                                                          60000
                                                                                                                                                                                          +
                                                                                                                                                                                          60000
                                                                                                                                                                                           
                                                                                                                                                                                          -
                                                                                                                                                                                          +
                                                                                                                                                                                          diff --git a/docs/interfaces/src.WorkerStatistics.html b/docs/interfaces/src.WorkerStatistics.html index 67cc8ea62..e7617957e 100644 --- a/docs/interfaces/src.WorkerStatistics.html +++ b/docs/interfaces/src.WorkerStatistics.html @@ -1,6 +1,6 @@ -WorkerStatistics | poolifier - v5.0.0
                                                                                                                                                                                          poolifier - v5.0.0
                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                            Interface WorkerStatisticsInternal

                                                                                                                                                                                            Worker task performance statistics computation settings.

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

                                                                                                                                                                                            Properties

                                                                                                                                                                                            elu +WorkerStatistics | poolifier - v5.0.1
                                                                                                                                                                                            poolifier - v5.0.1
                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                              Interface WorkerStatisticsInternal

                                                                                                                                                                                              Worker task performance statistics computation settings.

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

                                                                                                                                                                                              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 9984d34fe..aa7054615 100644 --- a/docs/interfaces/src.WorkerUsage.html +++ b/docs/interfaces/src.WorkerUsage.html @@ -1,10 +1,10 @@ -WorkerUsage | poolifier - v5.0.0
                                                                                                                                                                                              poolifier - v5.0.0
                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                Interface WorkerUsageInternal

                                                                                                                                                                                                Worker usage statistics.

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

                                                                                                                                                                                                Properties

                                                                                                                                                                                                elu +WorkerUsage | poolifier - v5.0.1
                                                                                                                                                                                                poolifier - v5.0.1
                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                  Interface WorkerUsageInternal

                                                                                                                                                                                                  Worker usage statistics.

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

                                                                                                                                                                                                  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 10b58420e..d955d0b55 100644 --- a/docs/modules/src.html +++ b/docs/modules/src.html @@ -1 +1 @@ -src | poolifier - v5.0.0
                                                                                                                                                                                                  poolifier - v5.0.0
                                                                                                                                                                                                    Preparing search index...
                                                                                                                                                                                                    +src | poolifier - v5.0.1
                                                                                                                                                                                                    poolifier - v5.0.1
                                                                                                                                                                                                      Preparing search index...
                                                                                                                                                                                                      diff --git a/docs/types/src.ClusterPoolOptions.html b/docs/types/src.ClusterPoolOptions.html index 207db5e40..19f01a289 100644 --- a/docs/types/src.ClusterPoolOptions.html +++ b/docs/types/src.ClusterPoolOptions.html @@ -1,2 +1,2 @@ -ClusterPoolOptions | poolifier - v5.0.0
                                                                                                                                                                                                      poolifier - v5.0.0
                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                        Type Alias ClusterPoolOptions

                                                                                                                                                                                                        ClusterPoolOptions: PoolOptions<Worker>

                                                                                                                                                                                                        Options for a poolifier cluster pool.

                                                                                                                                                                                                        -
                                                                                                                                                                                                        +ClusterPoolOptions | poolifier - v5.0.1
                                                                                                                                                                                                        poolifier - v5.0.1
                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                          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 af17bff08..16e963476 100644 --- a/docs/types/src.ErrorHandler.html +++ b/docs/types/src.ErrorHandler.html @@ -1,3 +1,3 @@ -ErrorHandler | poolifier - v5.0.0
                                                                                                                                                                                                          poolifier - v5.0.0
                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                            Type Alias ErrorHandler<Worker>

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

                                                                                                                                                                                                            Callback invoked if the worker raised an error.

                                                                                                                                                                                                            +ErrorHandler | poolifier - v5.0.1
                                                                                                                                                                                                            poolifier - v5.0.1
                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                              Type Alias ErrorHandler<Worker>

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

                                                                                                                                                                                                              Callback invoked if the worker raised an error.

                                                                                                                                                                                                              Type Parameters

                                                                                                                                                                                                              • Worker extends IWorker

                                                                                                                                                                                                                Type of worker.

                                                                                                                                                                                                                -

                                                                                                                                                                                                              Type declaration

                                                                                                                                                                                                                • (this: Worker, error: Error): void
                                                                                                                                                                                                                • Parameters

                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                              +

                                                                                                                                                                                                              Type declaration

                                                                                                                                                                                                                • (this: Worker, error: Error): void
                                                                                                                                                                                                                • Parameters

                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                              diff --git a/docs/types/src.EventHandler.html b/docs/types/src.EventHandler.html index 5eb1c213c..95ed212a7 100644 --- a/docs/types/src.EventHandler.html +++ b/docs/types/src.EventHandler.html @@ -1,3 +1,3 @@ -EventHandler | poolifier - v5.0.0
                                                                                                                                                                                                              poolifier - v5.0.0
                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                Type Alias EventHandler<Worker>

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

                                                                                                                                                                                                                Worker event handler.

                                                                                                                                                                                                                +EventHandler | poolifier - v5.0.1
                                                                                                                                                                                                                poolifier - v5.0.1
                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                  Type Alias EventHandler<Worker>

                                                                                                                                                                                                                  EventHandler:
                                                                                                                                                                                                                      | 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 a7c8c1f88..a0b0dc09d 100644 --- a/docs/types/src.ExitHandler.html +++ b/docs/types/src.ExitHandler.html @@ -1,3 +1,3 @@ -ExitHandler | poolifier - v5.0.0
                                                                                                                                                                                                                  poolifier - v5.0.0
                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                    Type Alias ExitHandler<Worker>

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

                                                                                                                                                                                                                    Callback invoked when the worker exits successfully.

                                                                                                                                                                                                                    +ExitHandler | poolifier - v5.0.1
                                                                                                                                                                                                                    poolifier - v5.0.1
                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                      Type Alias ExitHandler<Worker>

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

                                                                                                                                                                                                                      Callback invoked when the worker exits successfully.

                                                                                                                                                                                                                      Type Parameters

                                                                                                                                                                                                                      • Worker extends IWorker

                                                                                                                                                                                                                        Type of worker.

                                                                                                                                                                                                                        -

                                                                                                                                                                                                                      Type declaration

                                                                                                                                                                                                                        • (this: Worker, exitCode: number): void
                                                                                                                                                                                                                        • Parameters

                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                      +

                                                                                                                                                                                                                      Type declaration

                                                                                                                                                                                                                        • (this: Worker, exitCode: number): void
                                                                                                                                                                                                                        • Parameters

                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                      diff --git a/docs/types/src.KillBehavior.html b/docs/types/src.KillBehavior.html index 16fe7900c..205b18879 100644 --- a/docs/types/src.KillBehavior.html +++ b/docs/types/src.KillBehavior.html @@ -1,2 +1,2 @@ -KillBehavior | poolifier - v5.0.0
                                                                                                                                                                                                                      poolifier - v5.0.0
                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                        Type Alias KillBehavior

                                                                                                                                                                                                                        KillBehavior: keyof typeof KillBehaviors

                                                                                                                                                                                                                        Kill behavior.

                                                                                                                                                                                                                        -
                                                                                                                                                                                                                        +KillBehavior | poolifier - v5.0.1
                                                                                                                                                                                                                        poolifier - v5.0.1
                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                          Type Alias KillBehavior

                                                                                                                                                                                                                          KillBehavior: keyof typeof KillBehaviors

                                                                                                                                                                                                                          Kill behavior.

                                                                                                                                                                                                                          +
                                                                                                                                                                                                                          diff --git a/docs/types/src.KillHandler.html b/docs/types/src.KillHandler.html index 7dcd47543..13e5a8577 100644 --- a/docs/types/src.KillHandler.html +++ b/docs/types/src.KillHandler.html @@ -1,2 +1,2 @@ -KillHandler | poolifier - v5.0.0
                                                                                                                                                                                                                          poolifier - v5.0.0
                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                            Type Alias KillHandler

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

                                                                                                                                                                                                                            Handler called when a worker is killed.

                                                                                                                                                                                                                            -

                                                                                                                                                                                                                            Type declaration

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

                                                                                                                                                                                                                            +KillHandler | poolifier - v5.0.1
                                                                                                                                                                                                                            poolifier - v5.0.1
                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                              Type Alias KillHandler

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

                                                                                                                                                                                                                              Handler called when a worker is killed.

                                                                                                                                                                                                                              +

                                                                                                                                                                                                                              Type declaration

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

                                                                                                                                                                                                                              diff --git a/docs/types/src.Measurement.html b/docs/types/src.Measurement.html index b6de8885a..5d0450a01 100644 --- a/docs/types/src.Measurement.html +++ b/docs/types/src.Measurement.html @@ -1,2 +1,2 @@ -Measurement | poolifier - v5.0.0
                                                                                                                                                                                                                              poolifier - v5.0.0
                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                Type Alias Measurement

                                                                                                                                                                                                                                Measurement: keyof typeof Measurements

                                                                                                                                                                                                                                Measurement.

                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                +Measurement | poolifier - v5.0.1
                                                                                                                                                                                                                                poolifier - v5.0.1
                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                  Type Alias Measurement

                                                                                                                                                                                                                                  Measurement: keyof typeof Measurements

                                                                                                                                                                                                                                  Measurement.

                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                  diff --git a/docs/types/src.MessageHandler.html b/docs/types/src.MessageHandler.html index 78bd3bb85..c587ea1e2 100644 --- a/docs/types/src.MessageHandler.html +++ b/docs/types/src.MessageHandler.html @@ -1,3 +1,3 @@ -MessageHandler | poolifier - v5.0.0
                                                                                                                                                                                                                                  poolifier - v5.0.0
                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                    Type Alias MessageHandler<Worker>

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

                                                                                                                                                                                                                                    Callback invoked if the worker has received a message.

                                                                                                                                                                                                                                    +MessageHandler | poolifier - v5.0.1
                                                                                                                                                                                                                                    poolifier - v5.0.1
                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                      Type Alias MessageHandler<Worker>

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

                                                                                                                                                                                                                                      Callback invoked if the worker has received a message.

                                                                                                                                                                                                                                      Type Parameters

                                                                                                                                                                                                                                      • Worker extends IWorker

                                                                                                                                                                                                                                        Type of worker.

                                                                                                                                                                                                                                        -

                                                                                                                                                                                                                                      Type declaration

                                                                                                                                                                                                                                        • (this: Worker, message: unknown): void
                                                                                                                                                                                                                                        • Parameters

                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                      Type declaration

                                                                                                                                                                                                                                        • (this: Worker, message: unknown): void
                                                                                                                                                                                                                                        • Parameters

                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                      diff --git a/docs/types/src.OnlineHandler.html b/docs/types/src.OnlineHandler.html index 313929e26..47dedadd9 100644 --- a/docs/types/src.OnlineHandler.html +++ b/docs/types/src.OnlineHandler.html @@ -1,3 +1,3 @@ -OnlineHandler | poolifier - v5.0.0
                                                                                                                                                                                                                                      poolifier - v5.0.0
                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                        Type Alias OnlineHandler<Worker>

                                                                                                                                                                                                                                        OnlineHandler: (this: Worker) => void

                                                                                                                                                                                                                                        Callback invoked when the worker has started successfully.

                                                                                                                                                                                                                                        +OnlineHandler | poolifier - v5.0.1
                                                                                                                                                                                                                                        poolifier - v5.0.1
                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                          Type Alias OnlineHandler<Worker>

                                                                                                                                                                                                                                          OnlineHandler: (this: Worker) => void

                                                                                                                                                                                                                                          Callback invoked when the worker has started successfully.

                                                                                                                                                                                                                                          Type Parameters

                                                                                                                                                                                                                                          • Worker extends IWorker

                                                                                                                                                                                                                                            Type of worker.

                                                                                                                                                                                                                                            -

                                                                                                                                                                                                                                          Type declaration

                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                          Type declaration

                                                                                                                                                                                                                                          diff --git a/docs/types/src.PoolEvent.html b/docs/types/src.PoolEvent.html index e596fedd9..8406991be 100644 --- a/docs/types/src.PoolEvent.html +++ b/docs/types/src.PoolEvent.html @@ -1,2 +1,2 @@ -PoolEvent | poolifier - v5.0.0
                                                                                                                                                                                                                                          poolifier - v5.0.0
                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                            Type Alias PoolEvent

                                                                                                                                                                                                                                            PoolEvent: keyof typeof PoolEvents

                                                                                                                                                                                                                                            Pool event.

                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                            +PoolEvent | poolifier - v5.0.1
                                                                                                                                                                                                                                            poolifier - v5.0.1
                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                              Type Alias PoolEvent

                                                                                                                                                                                                                                              PoolEvent: keyof typeof PoolEvents

                                                                                                                                                                                                                                              Pool event.

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                              diff --git a/docs/types/src.PoolType.html b/docs/types/src.PoolType.html index 68afc3c84..abdc93cad 100644 --- a/docs/types/src.PoolType.html +++ b/docs/types/src.PoolType.html @@ -1,2 +1,2 @@ -PoolType | poolifier - v5.0.0
                                                                                                                                                                                                                                              poolifier - v5.0.0
                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                Type Alias PoolType

                                                                                                                                                                                                                                                PoolType: keyof typeof PoolTypes

                                                                                                                                                                                                                                                Pool type.

                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                +PoolType | poolifier - v5.0.1
                                                                                                                                                                                                                                                poolifier - v5.0.1
                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                  Type Alias PoolType

                                                                                                                                                                                                                                                  PoolType: keyof typeof PoolTypes

                                                                                                                                                                                                                                                  Pool type.

                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                  diff --git a/docs/types/src.TaskAsyncFunction.html b/docs/types/src.TaskAsyncFunction.html index 3babcf6d9..5d98a5302 100644 --- a/docs/types/src.TaskAsyncFunction.html +++ b/docs/types/src.TaskAsyncFunction.html @@ -1,7 +1,7 @@ -TaskAsyncFunction | poolifier - v5.0.0
                                                                                                                                                                                                                                                  poolifier - v5.0.0
                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                    Type Alias TaskAsyncFunction<Data, Response>

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

                                                                                                                                                                                                                                                    Task asynchronous function that can be executed. +TaskAsyncFunction | poolifier - v5.0.1

                                                                                                                                                                                                                                                    poolifier - v5.0.1
                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                      Type Alias TaskAsyncFunction<Data, Response>

                                                                                                                                                                                                                                                      TaskAsyncFunction: (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?: 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 1ce3a0e1f..f3c73f937 100644 --- a/docs/types/src.TaskFunction.html +++ b/docs/types/src.TaskFunction.html @@ -1,5 +1,5 @@ -TaskFunction | poolifier - v5.0.0
                                                                                                                                                                                                                                                      poolifier - v5.0.0
                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                        Type Alias TaskFunction<Data, Response>

                                                                                                                                                                                                                                                        TaskFunction:
                                                                                                                                                                                                                                                            | TaskAsyncFunction<Data, Response>
                                                                                                                                                                                                                                                            | TaskSyncFunction<Data, Response>

                                                                                                                                                                                                                                                        Task function that can be executed. +TaskFunction | poolifier - v5.0.1

                                                                                                                                                                                                                                                        poolifier - v5.0.1
                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                          Type Alias TaskFunction<Data, Response>

                                                                                                                                                                                                                                                          TaskFunction:
                                                                                                                                                                                                                                                              | TaskAsyncFunction<Data, Response>
                                                                                                                                                                                                                                                              | TaskSyncFunction<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 6cb4905f3..6d0cdc832 100644 --- a/docs/types/src.TaskFunctions.html +++ b/docs/types/src.TaskFunctions.html @@ -1,6 +1,6 @@ -TaskFunctions | poolifier - v5.0.0
                                                                                                                                                                                                                                                          poolifier - v5.0.0
                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                            Type Alias TaskFunctions<Data, Response>

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

                                                                                                                                                                                                                                                            Tasks functions that can be executed. +TaskFunctions | poolifier - v5.0.1

                                                                                                                                                                                                                                                            poolifier - v5.0.1
                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                              Type Alias TaskFunctions<Data, Response>

                                                                                                                                                                                                                                                              TaskFunctions: 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 514e07293..acdc89abe 100644 --- a/docs/types/src.TaskSyncFunction.html +++ b/docs/types/src.TaskSyncFunction.html @@ -1,6 +1,6 @@ -TaskSyncFunction | poolifier - v5.0.0
                                                                                                                                                                                                                                                              poolifier - v5.0.0
                                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                                Type Alias TaskSyncFunction<Data, Response>

                                                                                                                                                                                                                                                                TaskSyncFunction: (data?: Data) => Response

                                                                                                                                                                                                                                                                Task synchronous function that can be executed.

                                                                                                                                                                                                                                                                +TaskSyncFunction | poolifier - v5.0.1
                                                                                                                                                                                                                                                                poolifier - v5.0.1
                                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                                  Type Alias TaskSyncFunction<Data, Response>

                                                                                                                                                                                                                                                                  TaskSyncFunction: (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

                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                  diff --git a/docs/types/src.ThreadPoolOptions.html b/docs/types/src.ThreadPoolOptions.html index 80e161538..8b09f9cd4 100644 --- a/docs/types/src.ThreadPoolOptions.html +++ b/docs/types/src.ThreadPoolOptions.html @@ -1,2 +1,2 @@ -ThreadPoolOptions | poolifier - v5.0.0
                                                                                                                                                                                                                                                                  poolifier - v5.0.0
                                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                                    Type Alias ThreadPoolOptions

                                                                                                                                                                                                                                                                    ThreadPoolOptions: PoolOptions<Worker>

                                                                                                                                                                                                                                                                    Options for a poolifier thread pool.

                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                    +ThreadPoolOptions | poolifier - v5.0.1
                                                                                                                                                                                                                                                                    poolifier - v5.0.1
                                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                                      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 dc59db2cb..280e28fc7 100644 --- a/docs/types/src.WorkerChoiceStrategy.html +++ b/docs/types/src.WorkerChoiceStrategy.html @@ -1,2 +1,2 @@ -WorkerChoiceStrategy | poolifier - v5.0.0
                                                                                                                                                                                                                                                                      poolifier - v5.0.0
                                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                                        Type Alias WorkerChoiceStrategy

                                                                                                                                                                                                                                                                        WorkerChoiceStrategy: keyof typeof WorkerChoiceStrategies

                                                                                                                                                                                                                                                                        Worker choice strategy.

                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                        +WorkerChoiceStrategy | poolifier - v5.0.1
                                                                                                                                                                                                                                                                        poolifier - v5.0.1
                                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                                          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 d82ec77e4..71bf67ce5 100644 --- a/docs/types/src.WorkerType.html +++ b/docs/types/src.WorkerType.html @@ -1,2 +1,2 @@ -WorkerType | poolifier - v5.0.0
                                                                                                                                                                                                                                                                          poolifier - v5.0.0
                                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                                            Type Alias WorkerType

                                                                                                                                                                                                                                                                            WorkerType: keyof typeof WorkerTypes

                                                                                                                                                                                                                                                                            Worker type.

                                                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                                                            +WorkerType | poolifier - v5.0.1
                                                                                                                                                                                                                                                                            poolifier - v5.0.1
                                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                                              Type Alias WorkerType

                                                                                                                                                                                                                                                                              WorkerType: keyof typeof WorkerTypes

                                                                                                                                                                                                                                                                              Worker type.

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              diff --git a/docs/types/src.Writable.html b/docs/types/src.Writable.html index 9f3210601..ce30d7367 100644 --- a/docs/types/src.Writable.html +++ b/docs/types/src.Writable.html @@ -1,3 +1,3 @@ -Writable | poolifier - v5.0.0
                                                                                                                                                                                                                                                                              poolifier - v5.0.0
                                                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                                                Type Alias Writable<T>Internal

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

                                                                                                                                                                                                                                                                                Remove readonly modifier from all properties of T.

                                                                                                                                                                                                                                                                                +Writable | poolifier - v5.0.1
                                                                                                                                                                                                                                                                                poolifier - v5.0.1
                                                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                                                  Type Alias Writable<T>Internal

                                                                                                                                                                                                                                                                                  Writable: { -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 b34441645..5dc41c81b 100644 --- a/docs/variables/src.KillBehaviors.html +++ b/docs/variables/src.KillBehaviors.html @@ -1,2 +1,2 @@ -KillBehaviors | poolifier - v5.0.0
                                                                                                                                                                                                                                                                                  poolifier - v5.0.0
                                                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                                                    Variable KillBehaviorsConst

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

                                                                                                                                                                                                                                                                                    Enumeration of kill behaviors.

                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                    +KillBehaviors | poolifier - v5.0.1
                                                                                                                                                                                                                                                                                    poolifier - v5.0.1
                                                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                                                      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 c0383a0c8..7fb52cfff 100644 --- a/docs/variables/src.Measurements.html +++ b/docs/variables/src.Measurements.html @@ -1,2 +1,2 @@ -Measurements | poolifier - v5.0.0
                                                                                                                                                                                                                                                                                      poolifier - v5.0.0
                                                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                                                        Variable MeasurementsConst

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

                                                                                                                                                                                                                                                                                        Enumeration of measurements.

                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                        +Measurements | poolifier - v5.0.1
                                                                                                                                                                                                                                                                                        poolifier - v5.0.1
                                                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                                                          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 b86553cea..d5f79e1cf 100644 --- a/docs/variables/src.PoolEvents.html +++ b/docs/variables/src.PoolEvents.html @@ -1,2 +1,2 @@ -PoolEvents | poolifier - v5.0.0
                                                                                                                                                                                                                                                                                          poolifier - v5.0.0
                                                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                                                            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 - v5.0.1
                                                                                                                                                                                                                                                                                            poolifier - v5.0.1
                                                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                                                              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 0e7afe79b..7cbd5d2f7 100644 --- a/docs/variables/src.PoolTypes.html +++ b/docs/variables/src.PoolTypes.html @@ -1,2 +1,2 @@ -PoolTypes | poolifier - v5.0.0
                                                                                                                                                                                                                                                                                              poolifier - v5.0.0
                                                                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                                                                Variable PoolTypesConst

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

                                                                                                                                                                                                                                                                                                Enumeration of pool types.

                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                +PoolTypes | poolifier - v5.0.1
                                                                                                                                                                                                                                                                                                poolifier - v5.0.1
                                                                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                                                                  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 b7aa4b5de..efdffbf07 100644 --- a/docs/variables/src.WorkerChoiceStrategies.html +++ b/docs/variables/src.WorkerChoiceStrategies.html @@ -1,2 +1,2 @@ -WorkerChoiceStrategies | poolifier - v5.0.0
                                                                                                                                                                                                                                                                                                  poolifier - v5.0.0
                                                                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                                                                    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 - v5.0.1
                                                                                                                                                                                                                                                                                                    poolifier - v5.0.1
                                                                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                                                                      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 c8a03f10f..510249157 100644 --- a/docs/variables/src.WorkerTypes.html +++ b/docs/variables/src.WorkerTypes.html @@ -1,2 +1,2 @@ -WorkerTypes | poolifier - v5.0.0
                                                                                                                                                                                                                                                                                                      poolifier - v5.0.0
                                                                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                                                                        Variable WorkerTypesConst

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

                                                                                                                                                                                                                                                                                                        Enumeration of worker types.

                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                        +WorkerTypes | poolifier - v5.0.1
                                                                                                                                                                                                                                                                                                        poolifier - v5.0.1
                                                                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                                                                          Variable WorkerTypesConst

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

                                                                                                                                                                                                                                                                                                          Enumeration of worker types.

                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                          -- 2.43.0