poolifier - v5.1.0
    Preparing search index...

    Interface MessageValue<Data, ErrorData>Internal

    Message object that is passed between main worker and worker.

    interface MessageValue<Data = unknown, ErrorData = unknown> {
        abortable?: boolean;
        checkActive?: boolean;
        data?: Data;
        kill?: true | "success" | "HARD" | "SOFT" | "failure";
        name?: string;
        port?: MessagePort;
        priority?: number;
        ready?: boolean;
        statistics?: WorkerStatistics;
        strategy?:
            | "FAIR_SHARE"
            | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
            | "LEAST_BUSY"
            | "LEAST_ELU"
            | "LEAST_USED"
            | "ROUND_ROBIN"
            | "WEIGHTED_ROUND_ROBIN";
        taskFunction?: string;
        taskFunctionOperation?: "add"
        | "default"
        | "remove";
        taskFunctionOperationStatus?: boolean;
        taskFunctionProperties?: TaskFunctionProperties;
        taskFunctionsProperties?: TaskFunctionProperties[];
        taskId?: `${string}-${string}-${string}-${string}-${string}`;
        taskOperation?: "abort";
        taskPerformance?: TaskPerformance;
        timestamp?: number;
        transferList?: readonly Transferable[];
        workerError?: WorkerError<ErrorData>;
        workerId?: number;
    }

    Type Parameters

    • Data = unknown

      Type of data sent to the worker or execution response. This can only be structured-cloneable data.

    • ErrorData = unknown

      Type of data sent to the worker triggering an error. This can only be structured-cloneable data.

    Hierarchy (View Summary)

    Index

    Properties

    abortable?: boolean

    Whether the task is abortable or not.

    checkActive?: boolean

    Whether the worker starts or stops its activity check.

    data?: Data

    Task input data that will be passed to the worker.

    kill?: true | "success" | "HARD" | "SOFT" | "failure"

    Kill code.

    name?: string

    Task name.

    port?: MessagePort

    Message port.

    priority?: number

    Task priority. Lower values have higher priority.

    0
    
    ready?: boolean

    Whether the worker is ready or not.

    statistics?: WorkerStatistics

    Whether the worker computes the given statistics or not.

    strategy?:
        | "FAIR_SHARE"
        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "LEAST_USED"
        | "ROUND_ROBIN"
        | "WEIGHTED_ROUND_ROBIN"

    Task worker choice strategy.

    taskFunction?: string

    Task function serialized to string.

    taskFunctionOperation?: "add" | "default" | "remove"

    Task function operation:

    • 'add' - Add a task function.
    • 'remove' - Remove a task function.
    • 'default' - Set a task function as default.
    taskFunctionOperationStatus?: boolean

    Whether the task function operation is successful or not.

    taskFunctionProperties?: TaskFunctionProperties

    Task function properties.

    taskFunctionsProperties?: TaskFunctionProperties[]

    Task functions properties.

    taskId?: `${string}-${string}-${string}-${string}-${string}`

    Task UUID.

    taskOperation?: "abort"

    Task operation:

    • 'abort' - Abort a task.
    taskPerformance?: TaskPerformance

    Task performance.

    timestamp?: number

    Timestamp.

    transferList?: readonly Transferable[]

    Array of transferable objects.

    workerError?: WorkerError<ErrorData>

    Worker error.

    workerId?: number

    Worker id.