X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Finterfaces%2FWorkerOptions.html;h=b73a86cc50b8980dc57a86d69992adbb388d9fd5;hb=d67bed32f766d3db7c436ce1a1b9b8dfc3f4633a;hp=c4be5656634ec1c8cdcb05e55f869a9e4fa5a648;hpb=a8121a374142573fd761d5dd112d5f91ed1b618f;p=poolifier.git diff --git a/docs/interfaces/WorkerOptions.html b/docs/interfaces/WorkerOptions.html index c4be5656..b73a86cc 100644 --- a/docs/interfaces/WorkerOptions.html +++ b/docs/interfaces/WorkerOptions.html @@ -1,8 +1,8 @@ -WorkerOptions | poolifier - v3.1.6

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.

+WorkerOptions | poolifier - v3.1.21

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.

  • SOFT: If currentTime - lastActiveTime is greater than maxInactiveTime but a task is still executing or queued, then the worker won't be deleted.
  • HARD: If currentTime - lastActiveTime is greater than maxInactiveTime but a task is still executing or queued, then the worker will be deleted.
  • @@ -10,9 +10,9 @@

    This option only apply to the newly created workers.

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.

    @@ -22,4 +22,4 @@ when this timeout expires your tasks is interrupted before completion and remove

Default Value

60000
 
-

Generated using TypeDoc

\ No newline at end of file +

Generated using TypeDoc

\ No newline at end of file