X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FThreadWorker.html;h=cffee599edbc9c129576b25fb261046c49a99f52;hb=b667be1103b9362ae29d094de05f812468464d4f;hp=aa550ec10ab952b5ebf03fff382f19a199575c92;hpb=3a592a1254b999797590d1b54662b747eed17528;p=poolifier.git diff --git a/docs/classes/ThreadWorker.html b/docs/classes/ThreadWorker.html index aa550ec1..cffee599 100644 --- a/docs/classes/ThreadWorker.html +++ b/docs/classes/ThreadWorker.html @@ -1,4 +1,4 @@ -ThreadWorker | poolifier
+ThreadWorker | poolifier - v2.6.8
  • Preparing search index...
  • -
  • The search index is not available
poolifier
+
  • The search index is not available
  • poolifier - v2.6.8
    @@ -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,38 +55,44 @@ but the minimum number of workers will be guaranteed.

    Constructors

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

      @@ -98,82 +107,118 @@ but the minimum number of workers will be guaranteed.

      Parameters

      • -
        fn: WorkerFunction<Data, Response>
        -

        Function processed by the worker when the pool's execution function is invoked.

        -
      • +
        taskFunctions: WorkerFunction<Data, Response> | TaskFunctions<Data, Response>
        +

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

        +
        +
      • opts: WorkerOptions = {}

        Options for the worker.

        -
    -

    Returns ThreadWorker<Data, Response>

    Properties

    - +
    aliveInterval?: Timeout

    Handler id of the aliveInterval worker alive check.

    -
    +
  • Defined in src/worker/abstract-worker.ts:58
  • - +
    isMain: boolean

    Whether this is the main worker or not.

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

    Timestamp of the last task processed by this worker.

    -
    +
  • Defined in src/worker/abstract-worker.ts:50
  • - -
    mainWorker: undefined | null | MessagePort
    + +
    mainWorker: MessagePort

    Reference to main worker.

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

    Options for the worker.

    -
    +
  • Defined in src/worker/abstract-worker.ts:75
  • +
    + +
    statistics: WorkerStatistics
    +

    Performance statistics computation requirements.

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

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

    +
    +
    +
    +

    Accessors

    +
    + +

    Methods

    - +
      - +
    • -

      Returns number

      The unique asyncId assigned to the resource.

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

    Returns Func & {
        asyncResource: AsyncResource;
    }

    +
  • Defined in node_modules/.pnpm/@types+node@20.4.0/node_modules/@types/node/async_hooks.d.ts:283
  • - +
    +
  • Defined in src/worker/abstract-worker.ts:202
  • - +
    +
  • Defined in node_modules/.pnpm/@types+node@20.4.0/node_modules/@types/node/async_hooks.d.ts:302
  • - +
    -
    - -
    +
    + + -

    Returns string

    Message of the error.

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

    Returns void

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

    Returns void

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

    Returns void

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

    Returns Func & {
        asyncResource: AsyncResource;
    }

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

    \ No newline at end of file