X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FAbstractWorker.html;h=151aa034a2abfc2e167919e358f8d238dbf5b581;hb=dab8c377b70fc962ec217f2aeb719842f9f94cd6;hp=388b91568f37a8f74f3a04cc4cbbcdb3faba48bf;hpb=3bd6a82e43e11294af91bbd19647944ac740169e;p=poolifier.git diff --git a/docs/classes/AbstractWorker.html b/docs/classes/AbstractWorker.html index 388b9156..151aa034 100644 --- a/docs/classes/AbstractWorker.html +++ b/docs/classes/AbstractWorker.html @@ -18,9 +18,9 @@

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

-
+

Type Parameters

-
+
  • Defined in src/worker/abstract-worker.ts:26
  • @@ -60,21 +60,23 @@ lastTaskTimestamp mainWorker opts +taskFunctions

    Methods

    asyncId bind checkAlive -checkFunctionInput +checkTaskFunctions checkWorkerOptions emitDestroy getMainWorker +getTaskFunction handleError messageListener -run runAsync runInAsyncScope +runSync sendToMainWorker triggerAsyncId bind @@ -84,13 +86,13 @@
      - +
    • Constructs a new poolifier worker.

      -
      +

      Type Parameters

      -
        +
        • MainWorker extends Worker | MessagePort

        • @@ -109,86 +111,90 @@

          Whether this is the main worker or not.

        • -
          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. The first function is the default function.

        • mainWorker: undefined | null | MainWorker

          Reference to main worker.

        • -
          opts: WorkerOptions = ...
          +
          opts: WorkerOptions = ...

          Options for the worker.

    -

    Returns AbstractWorker<MainWorker, Data, Response>

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

    -
    aliveInterval?: Timeout
    +
    aliveInterval?: Timeout

    Handler id of the aliveInterval worker alive check.

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

    Whether this is the main worker or not.

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

    Timestamp of the last task processed by this worker.

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

    Reference to main worker.

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

    Options for the worker.

    +
  • Defined in src/worker/abstract-worker.ts:59
  • +
    + +
    taskFunctions: Map<string, WorkerFunction<Data, Response>>
    +

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

    +

    Methods

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

    Returns Func & {
        asyncResource: AsyncResource;
    }

    +
  • Defined in node_modules/.pnpm/@types+node@20.1.1/node_modules/@types/node/async_hooks.d.ts:287
  • -
    - +
  • Defined in src/worker/abstract-worker.ts:179
  • +
    +
    +
  • Defined in src/worker/abstract-worker.ts:98
  • Returns void

    +
  • Defined in src/worker/abstract-worker.ts:86
  • +
  • Defined in node_modules/.pnpm/@types+node@20.1.1/node_modules/@types/node/async_hooks.d.ts:308
  • +
    + +
    +
  • Defined in src/worker/abstract-worker.ts:261
  • -

    Returns string

    +
  • Defined in src/worker/abstract-worker.ts:194
  • -
    - -
    +
  • Defined in src/worker/abstract-worker.ts:138
  • +
  • Defined in src/worker/abstract-worker.ts:231
  • +
    + +
    +
  • Defined in src/worker/abstract-worker.ts:174
  • +
  • Defined in node_modules/.pnpm/@types+node@20.1.1/node_modules/@types/node/async_hooks.d.ts:317
  • @@ -520,6 +535,7 @@ the AsyncResource to which the function is bound.

  • FixedClusterPool
  • FixedThreadPool
  • PoolEmitter
  • +
  • Queue
  • ThreadWorker
  • WorkerChoiceStrategyContext
  • ClusterPoolOptions
  • @@ -543,6 +559,7 @@ the AsyncResource to which the function is bound.

  • MessageHandler
  • OnlineHandler
  • PoolEvent
  • +
  • TaskFunctions
  • ThreadWorkerWithMessageChannel
  • WorkerAsyncFunction
  • WorkerChoiceStrategy