X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FThreadWorker.html;h=21ec83ec77e142c84ca9b1417a00d70dbf7dafb9;hb=c65efde664ab9e4dcd2ed9e827d8171e7e081359;hp=62198283e49923fb181a0cf522035b8304ea8afc;hpb=73d8141b526469f4fce46da956280f2b9146accb;p=poolifier.git diff --git a/docs/classes/ThreadWorker.html b/docs/classes/ThreadWorker.html index 62198283..21ec83ec 100644 --- a/docs/classes/ThreadWorker.html +++ b/docs/classes/ThreadWorker.html @@ -1,4 +1,4 @@ -ThreadWorker | poolifier
+ThreadWorker | poolifier - v2.6.24
  • Preparing search index...
  • -
  • The search index is not available
poolifier
+
  • The search index is not available
  • poolifier - v2.6.24
    @@ -21,22 +21,25 @@ it will send a termination request to its main thread.

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

    +
    +
    +

    Author

    Alessandro Pio Ardizio

    -

    Author

    Alessandro Pio Ardizio

    - -

    Since

    0.0.1

    +

    Since

    0.0.1

    Type Parameters

    • Data = unknown

      -

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

      -
    • +

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

      -
    +

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

    +
    +

    Hierarchy

      @@ -44,7 +47,7 @@ but the minimum number of workers will be guaranteed.

      • ThreadWorker
    +
  • Defined in src/worker/thread-worker.ts:26
  • @@ -52,39 +55,51 @@ but the minimum number of workers will be guaranteed.

    Constructors

    - +
      - +
    • Constructs a new poolifier thread worker.

      @@ -99,88 +114,150 @@ but the minimum number of workers will be guaranteed.

      Parameters

    +
  • opts: WorkerOptions = {}

    Options for the worker.

    -
  • -

    Returns ThreadWorker<Data, Response>

    Properties

    -
    - -
    aliveInterval?: Timeout
    -

    Handler id of the aliveInterval worker alive check.

    -
    - +
    isMain: boolean

    Whether this is the main worker or not.

    -
    +
  • Defined in src/worker/abstract-worker.ts:75
  • - +
    lastTaskTimestamp: number

    Timestamp of the last task processed by this worker.

    -
    -
    - -
    mainWorker: undefined | null | MessagePort
    -

    Reference to main worker.

    -
    +
  • Defined in src/worker/abstract-worker.ts:55
  • - +
    opts: WorkerOptions = ...

    Options for the worker.

    -
    +
  • Defined in src/worker/abstract-worker.ts:78
  • +
    + +
    port: MessagePort
    +

    Message port used to communicate with the main worker.

    +
    +
    +
    + +
    statistics: WorkerStatistics
    +

    Performance statistics computation requirements.

    +
    +
    - -
    taskFunctions: Map<string, WorkerFunction<Data, Response>>
    + +
    taskFunctions: Map<string, TaskFunction<Data, Response>>

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

    -
    +
  • Defined in src/worker/abstract-worker.ts:51
  • +
    +

    Accessors

    +
    + +

    Methods

    +
    + +
    - +
      - +
    • -

      Returns number

      The unique asyncId assigned to the resource.

      -
    +
  • Defined in node_modules/.pnpm/@types+node@20.4.10/node_modules/@types/node/async_hooks.d.ts:306
  • - + -

    Returns Func

    -
    - - +

    Returns Func

    +
    +

    Since

    v14.8.0, v12.19.0

    +
    +
  • Defined in node_modules/.pnpm/@types+node@20.4.10/node_modules/@types/node/async_hooks.d.ts:283
  • - +
    +
  • Defined in node_modules/.pnpm/@types+node@20.4.10/node_modules/@types/node/async_hooks.d.ts:302
  • - +
    -
    - -
    +
    + + -

    Returns string

    Message of the error.

    -
    +
  • Defined in src/worker/thread-worker.ts:85
  • +
    + +
    +
    + +
    +
    + +
    +
    + +
    - + +

    Returns void

    +
    +
  • Defined in src/worker/abstract-worker.ts:295
  • +
    + +
    +
    + +
    - + +

    Returns void

    +
    +
  • Defined in src/worker/abstract-worker.ts:451
  • - +
    +
  • Defined in node_modules/.pnpm/@types+node@20.4.10/node_modules/@types/node/async_hooks.d.ts:294
  • - + +

    Returns void

    +
    +
  • Defined in src/worker/abstract-worker.ts:415
  • - + +

    Returns void

    +
    +
  • Defined in src/worker/thread-worker.ts:80
  • +
    + +
    - +
    +
  • Defined in node_modules/.pnpm/@types+node@20.4.10/node_modules/@types/node/async_hooks.d.ts:311
  • - + -

    Returns Func

    +
  • Defined in node_modules/.pnpm/@types+node@20.4.10/node_modules/@types/node/async_hooks.d.ts:277
  • +
  • constructor
  • +
  • activeInterval
  • +
  • isMain
  • +
  • lastTaskTimestamp
  • +
  • opts
  • +
  • port
  • +
  • statistics
  • +
  • taskFunctions
  • +
  • id
  • +
  • addTaskFunction
  • +
  • asyncId
  • +
  • bind
  • +
  • emitDestroy
  • +
  • getMainWorker
  • +
  • handleError
  • +
  • handleKillMessage
  • +
  • handleReadyMessage
  • +
  • hasTaskFunction
  • +
  • listTaskFunctions
  • +
  • messageListener
  • +
  • removeTaskFunction
  • +
  • run
  • +
  • runAsync
  • +
  • runInAsyncScope
  • +
  • runSync
  • +
  • sendToMainWorker
  • +
  • setDefaultTaskFunction
  • +
  • triggerAsyncId
  • +
  • bind
  • +
  • AbstractPool
  • +
  • AbstractWorker
  • +
  • CircularArray
  • +
  • ClusterWorker
  • +
  • DynamicClusterPool
  • +
  • DynamicThreadPool
  • +
  • FixedClusterPool
  • +
  • FixedThreadPool
  • +
  • PoolEmitter
  • +
  • Queue
  • +
  • ThreadWorker
  • +
  • WorkerChoiceStrategyContext
  • +
  • ClusterPoolOptions
  • +
  • EventLoopUtilizationMeasurementStatistics
  • +
  • IPool
  • +
  • IWorker
  • +
  • IWorkerChoiceStrategy
  • +
  • IWorkerNode
  • +
  • MeasurementOptions
  • +
  • MeasurementStatistics
  • +
  • MeasurementStatisticsRequirements
  • +
  • MessageValue
  • +
  • PoolInfo
  • +
  • PoolOptions
  • +
  • PromiseResponseWrapper
  • +
  • StrategyPolicy
  • +
  • Task
  • +
  • TaskError
  • +
  • TaskPerformance
  • +
  • TaskStatistics
  • +
  • TaskStatisticsRequirements
  • +
  • TasksQueueOptions
  • +
  • ThreadPoolOptions
  • +
  • WorkerChoiceStrategyOptions
  • +
  • WorkerInfo
  • +
  • WorkerOptions
  • +
  • WorkerStatistics
  • +
  • WorkerUsage
  • +
  • ErrorHandler
  • +
  • ExitHandler
  • +
  • KillBehavior
  • +
  • Measurement
  • +
  • MessageHandler
  • +
  • OnlineHandler
  • +
  • PoolEvent
  • +
  • PoolType
  • +
  • TaskAsyncFunction
  • +
  • TaskFunction
  • +
  • TaskFunctions
  • +
  • TaskSyncFunction
  • +
  • WorkerChoiceStrategy
  • +
  • WorkerType
  • +
  • KillBehaviors
  • +
  • Measurements
  • +
  • PoolEvents
  • +
  • PoolTypes
  • +
  • WorkerChoiceStrategies
  • +
  • WorkerTypes
  • +
  • availableParallelism
  • Generated using TypeDoc

    \ No newline at end of file