X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FAbstractWorker.html;h=151aa034a2abfc2e167919e358f8d238dbf5b581;hb=dab8c377b70fc962ec217f2aeb719842f9f94cd6;hp=b990d6d71a845df243c6fdd9faa492de6510f1e3;hpb=2946f23da560702e3f3631887e1eeb88777bd47d;p=poolifier.git diff --git a/docs/classes/AbstractWorker.html b/docs/classes/AbstractWorker.html index b990d6d7..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,8 +111,8 @@

          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
          @@ -123,7 +125,7 @@

          Returns AbstractWorker<MainWorker, Data, Response>

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

    Properties

    @@ -132,35 +134,42 @@

    Handler id of the aliveInterval worker alive check.

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

    Whether this is the main worker or not.

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

    Timestamp of the last task processed by this worker.

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

    Reference to main worker.

    +
  • Defined in src/worker/abstract-worker.ts:58
  • 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

    @@ -168,27 +177,24 @@
    +
  • 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
  • Returns void

    -
    - -
    +
  • Defined in src/worker/abstract-worker.ts:138
  • Returns void

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