X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FThreadWorker.html;h=850e2be0ef2559cc3d4f467452d32cc5095233f5;hb=40baeb4e66efa6646d3221029cd012fb7bda8955;hp=65bd248b54cf321315230c36a1888f8dc450fdf0;hpb=d61f24ac46792cfab91a154667f24fc57c90e66e;p=poolifier.git diff --git a/docs/classes/ThreadWorker.html b/docs/classes/ThreadWorker.html index 65bd248b..850e2be0 100644 --- a/docs/classes/ThreadWorker.html +++ b/docs/classes/ThreadWorker.html @@ -1,11 +1,13 @@ ThreadWorker | poolifier
-
+
@@ -20,10 +22,6 @@ 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.

-

Template

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

- -

Template

of response the worker sends back to the main thread. This can only be serializable data.

-

Author

Alessandro Pio Ardizio

Since

0.0.1

@@ -32,17 +30,21 @@ but the minimum number of workers will be guaranteed.

Type Parameters

  • -

    Data = unknown

  • +

    Data = unknown

    +

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

    +
  • -

    Response = unknown

+

Response = unknown

+

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

+

Hierarchy

    -
  • AbstractWorker<MessagePort, Data, Response> +
  • AbstractWorker<MessagePort, Data, Response>
    • ThreadWorker
+
  • Defined in src/worker/thread-worker.ts:21
  • @@ -55,9 +57,10 @@ but the minimum number of workers will be guaranteed.

    Properties

    Methods

    @@ -114,41 +117,51 @@ but the minimum number of workers will be guaranteed.

    Options for the worker.

    Returns ThreadWorker<Data, Response>

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

    aliveInterval?: Timeout
    -

    Handler Id of the aliveInterval worker alive check.

    +

    Handler id of the aliveInterval worker alive check.

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

    Whether this is the main worker or not.

    +
    lastTaskTimestamp: number

    Timestamp of the last task processed by this worker.

    +
  • Defined in src/worker/abstract-worker.ts:27
  • -
    mainWorker: undefined | null | MessagePort
    -
    - - +
  • Defined in src/worker/abstract-worker.ts:45
  • +
    + +
    opts: WorkerOptions = ...

    Options for the worker.

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

    @@ -160,13 +173,13 @@ but the minimum number of workers will be guaranteed.

    Returns

    The unique asyncId assigned to the resource.

    Returns number

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

    Returns Func & { asyncResource: AsyncResource }

    +
  • Defined in src/worker/abstract-worker.ts:146
  • +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:311
  • +
  • Defined in src/worker/abstract-worker.ts:129
  • Returns string

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

    +
  • Defined in src/worker/abstract-worker.ts:84
  • Returns Response

  • -
    value: MessageValue<Data, unknown>
    +
    message: MessageValue<Data, unknown>

    Input data for the given function.

  • Returns void

    +
  • Defined in src/worker/abstract-worker.ts:171
  • Returns Promise<Response>

  • -
    value: MessageValue<Data, unknown>
    +
    message: MessageValue<Data, unknown>

    Input data for the given function.

  • Returns void

    +
  • Defined in src/worker/abstract-worker.ts:198
  • Returns Result

    +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:303
  • Returns void

    +
  • Defined in src/worker/thread-worker.ts:36
  • +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:320
  • -

    Returns Func & { asyncResource: AsyncResource }

    +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:273