Interface TaskFunctionObject<Data, Response>

Task function object.

interface TaskFunctionObject<Data, Response> {
    priority?: number;
    strategy?:
        | "FAIR_SHARE"
        | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
        | "LEAST_BUSY"
        | "LEAST_ELU"
        | "LEAST_USED"
        | "ROUND_ROBIN"
        | "WEIGHTED_ROUND_ROBIN";
    taskFunction: TaskFunction<Data, Response>;
}

Type Parameters

  • Data = unknown

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

  • Response = unknown

    Type of execution response. This can only be structured-cloneable data.

Properties

priority?: number

Task function priority. Lower values have higher priority.

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

Task function worker choice strategy.

taskFunction: TaskFunction<Data, Response>

Task function.