X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Finterfaces%2FWorkerOptions.html;h=c8dbe2ddf4bf4add1aaa36a50ccbc46d0f5261b4;hb=c03520402c4c5f329df346b743b64da08555995c;hp=581b12b1b88ed542a07320d9f342167ef1695607;hpb=2493c34370d0839614058bb55254fd7aec91b664;p=poolifier.git diff --git a/docs/interfaces/WorkerOptions.html b/docs/interfaces/WorkerOptions.html index 581b12b1..c8dbe2dd 100644 --- a/docs/interfaces/WorkerOptions.html +++ b/docs/interfaces/WorkerOptions.html @@ -1,5 +1,5 @@ -WorkerOptions | poolifier - v4.0.11

Interface WorkerOptions

Options for workers.

-
interface WorkerOptions {
    killBehavior?: "SOFT" | "HARD";
    killHandler?: KillHandler;
    maxInactiveTime?: number;
}

Properties

killBehavior? +WorkerOptions | poolifier - v4.0.14

Interface WorkerOptions

Options for workers.

+
interface WorkerOptions {
    killBehavior?: "SOFT" | "HARD";
    killHandler?: KillHandler;
    maxInactiveTime?: number;
}

Properties

killBehavior?: "SOFT" | "HARD"

killBehavior dictates if your worker will be deleted in case a task is active on it.

@@ -8,11 +8,11 @@
  • HARD: If currentTime - lastActiveTime is greater than maxInactiveTime but the worker is stealing tasks or a task is executing or queued, then the worker will be deleted.
  • This option only apply to the newly created workers.

    -

    Default Value

    KillBehaviors.SOFT
    +

    Default Value

    KillBehaviors.SOFT
     
    -
    killHandler?: KillHandler

    The function to call when a worker is killed.

    +
    killHandler?: KillHandler

    The function to call when a worker is killed.

    Default Value

    () => {}

    -
    maxInactiveTime?: number

    Maximum waiting time in milliseconds for tasks on newly created workers. It must be greater or equal than 5.

    +
    maxInactiveTime?: number

    Maximum waiting time in milliseconds for tasks on newly created workers. It must be greater or equal than 5.

    After this time, newly created workers will be terminated. The last active time of your worker will be updated when it terminates a task.

      @@ -20,6 +20,6 @@ The last active time of your worker will be updated when it terminates a task.
    • If killBehavior is set to KillBehaviors.SOFT your tasks have no timeout and your workers will not be terminated until your task is completed.
    -

    Default Value

    60000
    +

    Default Value

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