X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FAbstractWorker.html;h=171b0c64063e4b200ea46b40bdd890fe8b835bf3;hb=6047493a00c2852f2c7f4329def8e1322c678cf1;hp=5ff29d945688f69d7286b7924b37b4433ecb8a6d;hpb=ed1ecf09c599769ed61771ec25d71c39c19ba70b;p=poolifier.git diff --git a/docs/classes/AbstractWorker.html b/docs/classes/AbstractWorker.html index 5ff29d94..171b0c64 100644 --- a/docs/classes/AbstractWorker.html +++ b/docs/classes/AbstractWorker.html @@ -1,13 +1,15 @@ -AbstractWorker | poolifier
+AbstractWorker | poolifier
-
+
-
+
+
  • Defined in src/worker/abstract-worker.ts:19
  • @@ -54,9 +56,10 @@

    Properties

    Methods

    @@ -81,7 +84,7 @@
      - +
    • Constructs a new poolifier worker.

      @@ -106,60 +109,69 @@

      Whether this is the main worker or not.

    • -
      fn: ((data: Data) => Response)
      +
      fn: ((data: Data) => Response | Promise<Response>)

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

        • -
        • (data: Data): Response
        • +
        • (data: Data): Response | Promise<Response>
        • Parameters

          • -
            data: Data
          -

          Returns Response

    • +
      data: Data
    +

    Returns Response | Promise<Response>

  • -
    mainWorker: undefined | null | MainWorker
    +
    mainWorker: undefined | null | MainWorker

    Reference to main worker.

  • opts: WorkerOptions = ...

    Options for the worker.

  • -

    Returns AbstractWorker<MainWorker, Data, Response>

    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 | MainWorker
    -
    - - +
  • Defined in src/worker/abstract-worker.ts:45
  • +
    + +
    opts: WorkerOptions = ...

    Options for the worker.

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

    @@ -173,11 +185,11 @@

    Returns number

    +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:315
    • - +
    • Binds the given function to execute to this AsyncResource's scope.

      The returned function will have an asyncResource property referencing @@ -194,51 +206,51 @@ the AsyncResource to which the function is bound.

      Parameters

      • -
        fn: Func
        +
        fn: Func

        The function to bind to the current AsyncResource.

      -

      Returns Func & { asyncResource: AsyncResource }

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

      Check to see if the worker should be terminated, because its living too long.

      +

      Checks if the worker should be terminated, because its living too long.

      Returns void

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

      Check if the fn parameter is passed to the constructor.

      +

      Checks if the fn parameter is passed to the constructor.

      Parameters

      • -
        fn: ((data: Data) => Response)
        +
        fn: ((data: Data) => Response | Promise<Response>)

        The function that should be defined.

          • -
          • (data: Data): Response
          • +
          • (data: Data): Response | Promise<Response>
          • Parameters

            • -
              data: Data
            -

            Returns Response

      +
      data: Data
    +

    Returns Response | Promise<Response>

    Returns void

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

    +
  • Defined in src/worker/abstract-worker.ts:105
  • +
  • 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:136
  • Returns string

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

    Returns Response | Promise<Response>

    Returns void

    +
  • Defined in src/worker/abstract-worker.ts:84
  • -
    value: MessageValue<Data, unknown>
    +
    message: MessageValue<Data, unknown>

    Input data for the given function.

  • Returns void

    +
  • Defined in src/worker/abstract-worker.ts:178
  • -
    value: MessageValue<Data, unknown>
    +
    message: MessageValue<Data, unknown>

    Input data for the given function.

  • Returns void

    +
  • Defined in src/worker/abstract-worker.ts:205
  • -
    Optional thisArg: This
    +
    Optional thisArg: This

    The receiver to be used for the function call.

  • Rest ...args: any[]

    Optional arguments to pass to the function.

  • -

    Returns Result

    +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:303
  • +
  • Defined in src/worker/abstract-worker.ts:148
  • +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:320
  • Parameters

    -

    Returns Func & { asyncResource: AsyncResource }

    +
    +
    -
    +
  • constructor
  • +
  • aliveInterval
  • +
  • isMain
  • +
  • lastTaskTimestamp
  • +
  • mainWorker
  • +
  • opts
  • +
  • asyncId
  • +
  • bind
  • +
  • checkAlive
  • +
  • checkFunctionInput
  • +
  • checkWorkerOptions
  • +
  • emitDestroy
  • +
  • getMainWorker
  • +
  • handleError
  • +
  • messageListener
  • +
  • run
  • +
  • runAsync
  • +
  • runInAsyncScope
  • +
  • sendToMainWorker
  • +
  • triggerAsyncId
  • +
  • bind
  • + +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file